Dropbox Public 文件夹中的文件不再显示在 WebBrowser 中,但它会打开 open/save 文件的对话框
Files in Dropbox Public folder are no longer shown in WebBrowser but it opens dialog to open/save file
我有一个简单的网络浏览器表单,它只导航到一个特定的网页,但是它没有导航到那个网页,而是提示我打开或保存文件,当单击 "Open" 它打开时我的默认网络浏览器,"Save" 让我保存 HTML 文件。
我不知道是什么原因造成的,非常感谢您的帮助。
我也向你保证语法是正确的, HTML 文件的 URL 也是正确的。
这不是您的代码的问题,而是 URL 的特定问题。使用 URL 我遇到了同样的问题。在 Firefox 中导航到 URL,我被要求保存文件。我将文件保存在本地并上传到我自己的 Dropbox 文件夹中。从那里,使用相同的文件名和相同的文件内容,该文件显示在浏览器中。
用Fiddler分析http流量,http结果在以下headers中有所不同。
来自您的 Dropbox 帐户:
content-disposition: attachment; filename=News.html
content-security-policy: referrer no-referrer; sandbox;
x-content-security-policy: referrer no-referrer; sandbox;
x-webkit-csp: referrer no-referrer; sandbox;
来自我的 Dropbox 帐户:
content-disposition: inline; filename="News.html"; filename*=UTF-8''News.html
content-security-policy: referrer no-referrer
x-content-security-policy: referrer no-referrer
x-webkit-csp: referrer no-referrer
请注意 "content-disposition: inline" 和 "content-disposition: attachment" 之间的区别,这使得浏览器提供下载而不是在浏览器中显示内联。另请注意您帐户回复中的额外 "Sandbox"。
对于这种不同的行为,我看到了两种可能的解释:
(不太可能)也许不同的帐户 运行 在具有不同 Dropbox 服务器软件版本的两个不同的 DropBox 服务器上。
Dropbox 可能有一种机制来分析对 public 文件的访问并识别看起来像是对 IT 系统的某些攻击的一部分的访问模式。所以,也许 Dropbox 已经对你的文件进行了处罚,因为它认为它已经识别出一些危险的 activity 正在处理它。
可能性 2 似乎是最有可能的。也许尝试重命名文件或将其放入不同的子文件夹中,然后就此问题联系 Dropbox。
问题是 Dropbox 本月已禁用免费帐户托管内容的内联显示。它仍然适用于我的帐户,因为我有一个付费 (Dropbox Pro) 帐户。
Dropbox 有以下信息in their documentation:
Dropbox Basic (free) users: Beginning October 3, 2016, you can no
longer use shared links to render HTML content in a web browser. If
you created a website that directly displays HTML content from your
Dropbox, it will no longer render in the browser. The HTML content
itself will still remain in your Dropbox and can be shared. Learn
more.
Dropbox Pro and Business users: Beginning September 1, 2017, you can
no longer render HTML content.
请注意,您有另一种方法可以让您仍然使用保管箱 并且 从您的 html 页面中获益。
Since October 3, 2016 Dropbox stopped serving html files with the correct text/html content-type header. .html and .json files are now served with a content-disposition header which makes the browser download the file instead of render it.
启动您自己的服务器:
CLIENT_ID="REMOVED" CLIENT_SECRET="REMOVED" ACCESS_TOKEN="REMOVED" go run server.go -hostname "db.sajalkayan.com"
(使用您自己的服务器名称更改主机名)
You need to create an app at the Dropbox developer portal.
CLIENT_ID
- "App key
"
CLIENT_SECRET
- "App secret
"
ACCESS_TOKEN
- Allow implicit grant and generate an access token.
hostname
- If configured the server listens over https on :443
and gets certificate from Let's Encrypt otherwise it listens over http on :8889
. folder
folder
- Defaults to /Public
: The Dropbox folder you want to expose.
我有一个简单的网络浏览器表单,它只导航到一个特定的网页,但是它没有导航到那个网页,而是提示我打开或保存文件,当单击 "Open" 它打开时我的默认网络浏览器,"Save" 让我保存 HTML 文件。
我不知道是什么原因造成的,非常感谢您的帮助。
我也向你保证语法是正确的, HTML 文件的 URL 也是正确的。
这不是您的代码的问题,而是 URL 的特定问题。使用 URL 我遇到了同样的问题。在 Firefox 中导航到 URL,我被要求保存文件。我将文件保存在本地并上传到我自己的 Dropbox 文件夹中。从那里,使用相同的文件名和相同的文件内容,该文件显示在浏览器中。
用Fiddler分析http流量,http结果在以下headers中有所不同。
来自您的 Dropbox 帐户:
content-disposition: attachment; filename=News.html
content-security-policy: referrer no-referrer; sandbox;
x-content-security-policy: referrer no-referrer; sandbox;
x-webkit-csp: referrer no-referrer; sandbox;
来自我的 Dropbox 帐户:
content-disposition: inline; filename="News.html"; filename*=UTF-8''News.html
content-security-policy: referrer no-referrer
x-content-security-policy: referrer no-referrer
x-webkit-csp: referrer no-referrer
请注意 "content-disposition: inline" 和 "content-disposition: attachment" 之间的区别,这使得浏览器提供下载而不是在浏览器中显示内联。另请注意您帐户回复中的额外 "Sandbox"。
对于这种不同的行为,我看到了两种可能的解释:
(不太可能)也许不同的帐户 运行 在具有不同 Dropbox 服务器软件版本的两个不同的 DropBox 服务器上。
Dropbox 可能有一种机制来分析对 public 文件的访问并识别看起来像是对 IT 系统的某些攻击的一部分的访问模式。所以,也许 Dropbox 已经对你的文件进行了处罚,因为它认为它已经识别出一些危险的 activity 正在处理它。
可能性 2 似乎是最有可能的。也许尝试重命名文件或将其放入不同的子文件夹中,然后就此问题联系 Dropbox。
问题是 Dropbox 本月已禁用免费帐户托管内容的内联显示。它仍然适用于我的帐户,因为我有一个付费 (Dropbox Pro) 帐户。
Dropbox 有以下信息in their documentation:
Dropbox Basic (free) users: Beginning October 3, 2016, you can no longer use shared links to render HTML content in a web browser. If you created a website that directly displays HTML content from your Dropbox, it will no longer render in the browser. The HTML content itself will still remain in your Dropbox and can be shared. Learn more.
Dropbox Pro and Business users: Beginning September 1, 2017, you can no longer render HTML content.
请注意,您有另一种方法可以让您仍然使用保管箱 并且 从您的 html 页面中获益。
Since October 3, 2016 Dropbox stopped serving html files with the correct text/html content-type header. .html and .json files are now served with a content-disposition header which makes the browser download the file instead of render it.
启动您自己的服务器:
CLIENT_ID="REMOVED" CLIENT_SECRET="REMOVED" ACCESS_TOKEN="REMOVED" go run server.go -hostname "db.sajalkayan.com"
(使用您自己的服务器名称更改主机名)
You need to create an app at the Dropbox developer portal.
CLIENT_ID
- "App key
"CLIENT_SECRET
- "App secret
"ACCESS_TOKEN
- Allow implicit grant and generate an access token.hostname
- If configured the server listens over https on:443
and gets certificate from Let's Encrypt otherwise it listens over http on:8889
. folderfolder
- Defaults to/Public
: The Dropbox folder you want to expose.