一个网页,可以提供一个用户从它下载某个文件,但不会透露该文件的位置 - 是否可能? [英] A web-page that would provide a user to download a certain file from it, but would not disclose the location of that file - is it possible at all?

查看:100
本文介绍了一个网页,可以提供一个用户从它下载某个文件,但不会透露该文件的位置 - 是否可能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

(如果我的问题不在正确的地方,我很抱歉(我一直在思考一段时间,得出结论,这一个是我问题的最佳选择)

(I am sorry if my question is not in the right place. (I've been thinking for awhile and came up to the conclusion that this one is the best place for my question)

是否可以创建一个HTML网页,提供用户从其下载某个文件,但不会透露该文件的位置(即用户不会知道该文件的URL他正在下载的文件)。

Is it possible to create such an HTML web-page that would provide a user to download a certain file from it, but would not disclose the location of that file (i.e. the user would not know the URL of the file that he is downloading).

如果是,请给我一些关于我应该使用哪个HTML代码来创建这样一个页面的指导。 / p>

If yes, would you, please, give me some directions as to which HTML code I should use to create such a page.

推荐答案

HTML页面将提供一个链接到服务器端脚本传递文件名或其他独特的名称:

The HTML page would provide a link to a server side script passing a filename or other unique moniker:

<a href="fetch.cgi?file=xxyyzz">Download Now</a>

脚本将读取标识符,从中导出完整路径,加载文件并使用相应的标题/ MIME类型将其写回导致浏览器提示用户使用正常的下载对话框。

The script would read the identifier, derive a full path from it, load the file and write it back with the appropriate headers/mime type causing the browser to prompt the user with the normal download dialog.

用户可以使用的唯一位置数据将是脚本的链接 - 除非您添加一些安全性 - 将文件提交回就像它是一个指向一个文件的标准URL。

The only location data available to the user would be the link to the script - which would - unless you add some security - serve back the file just as if it were a standard url pointing to a file.

PHP示例

这篇关于一个网页,可以提供一个用户从它下载某个文件,但不会透露该文件的位置 - 是否可能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆