在没有看到下载URL的情况下下载文件 [英] download a file without seeing the download URL

查看:95
本文介绍了在没有看到下载URL的情况下下载文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


就是这种情况:我有一个GoogleSite,我希望人们能够下载它.我可以将附件上传到他们的网站,但是空间很快就会用完.因此,我想将要下载的文件托管在文件托管站点上,我可以将托管站点的URL作为链接添加到GoogleSites上,以便当人们单击该文件时,它会打开一个新窗口,然后进行下载开始,但是我不希望下载文件的人能够看到下载链接,因为那样他们就可以将下载链接提供给他们的朋友,而不是通过我来访问.

GoogleSites的使用方式是,如果单击下载按钮,则URL会在下载URL之前闪烁一秒钟,然后再返回到页面URL.

我不知道.

有什么建议吗?


谢谢
duane

Hi,
This is the situation: I have a GoogleSite, and I want people to be able to download off it. I could upload as attachment to their site, but the space would soon run out. So, I want to host the file I am making available for download on a file hosting site, I could add the URL from the hosting site as a link on the GoogleSites so that when people click on it it opens a new window and the download begins, but I don''t want the people who download the files to be able to see the download link because then they could just give the download link to their friends instead of coming through me.

The way GoogleSites has it is that if you click on the download button the URL flashes for a second to the download URL and then back to the page URL.

I don''t know.

Any suggestions?


thanks
duane

推荐答案

您可以在自己的网站上创建一个中途页面.指向用户的链接转到oyur页面,然后您的页面通过从文件服务器中检索所需的下载,然后将其传递回用户,将所需的下载返回给他们.您将不得不更改响应内容类型并重写流,但这很容易.这样做的缺点是,它会减慢下载速度,因为首先您的服务器必须下载它,然后用户必须从您那里下载.

这是一个普遍的问题,大多数地方似乎都愿意直接链接到文件服务器(只是查看facebook上的大多数图像URL),但这是一个有效的问题.但是,如果您担心朋友重新分配和不安全的链接,则大多数人更有可能只是传递实际被淘汰的文件,而不传递该链接.

希望这会有所帮助,

Ed
You could create a page on your site that acts as a midway. The link to the user goes to oyur page and your page then returns the download they wanted to them by retrieving it from the file server and then passing it back to the user. You would have to change the reponse content type and rewrite the stream but that''s easy. The disadvantage of this is that it slows down the download as first your servers have to download it and then the user has to download from you.

This is a common problem and most places seem to settle for a direct link to the file server (just look at most of the image urls on facebook) but it is a valid problem. However, if you''re worried about friends redistributing and insecure link, most people are more likely just to pass on the actual downoaded file and not the link.

Hope this helps,

Ed


这篇关于在没有看到下载URL的情况下下载文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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