官网与门户文件收集

将安全上传表单直接嵌入自有网站

复用现有的 Coneshare File Request 收集链接,外部访客无需跳离你的业务门户域名即可直接提交大文件。

1. Iframe 嵌入代码片段

基于真实收集链接的可运行示例:

<iframe
  src="https://app.coneshare.com/upload/zDgMPy5kRgNy78K8c2XSQg?embed=1"
  title="Secure file upload"
  width="100%"
  height="760"
  style="border:0;max-width:720px"
  loading="lazy"
  referrerpolicy="strict-origin-when-cross-origin">
</iframe>

通用可复用模板:

<iframe
  src="https://app.coneshare.com/upload/<file_request_slug>?embed=1"
  title="Secure file upload"
  width="100%"
  height="760"
  style="border:0;max-width:720px"
  loading="lazy"
  referrerpolicy="strict-origin-when-cross-origin">
</iframe>

2. 在线嵌入预览

以下区域直接嵌入了测试收集地址 https://app.coneshare.com/upload/zDgMPy5kRgNy78K8c2XSQg ,用于直观确认样式与上传交互。

3. 反向代理响应头配置(必需)

生产环境下,请在最前端的 HTTPS 反向代理(如 Nginx)配置嵌入白名单安全头,不要修改容器内部 Web 服务配置。

# Default: deny framing for all routes
location / {
  proxy_pass http://coneshare_upstream;
  add_header X-Frame-Options "DENY" always;
  add_header Content-Security-Policy "frame-ancestors 'none'" always;
}

# Embed-enabled upload route only
location ~ ^/upload/ {
  proxy_pass http://coneshare_upstream;

  # Remove restrictive upstream headers on embed route
  proxy_hide_header X-Frame-Options;
  proxy_hide_header Content-Security-Policy;

  # Explicit allowlist for trusted embed origins
  add_header Content-Security-Policy "frame-ancestors 'self' https://www.example.com" always;
}
  • 在 frame-ancestors 中明确列出受信任的 HTTPS 源域名。
  • 生产环境请避免使用通配符来源。
  • 若应用部署在子路径前缀下(如 /app/upload/...),请相应调整路径匹配规则。

4. 上传链路与后端校验机制

嵌入模式与标准公开收集页共用完全一致的后端接口及安全校验:

  1. 申请直传上传 URL (/api/v1/public/file-requests/<slug>/request-upload/)
  2. 客户端直传文件至预签名存储地址
  3. 完成上传校验与落库 (/api/v1/public/file-requests/<slug>/finalize-upload/)

文件大小限制、允许类型、失效时间校验、存储配额检查与最终确认校验均保持不变。

需要完整的端到端配置参考?

既可在帮助中心查看业务用法,也可前往服务器运维手册查看 Nginx 嵌入与病毒扫描细节。