创建限时下载链接 [英] Create limited time download link

查看:102
本文介绍了创建限时下载链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须建立一个客户可以购买图像的网站。我想在

中让人们获得这些图像的两种方法是:通过电子邮件接收它们或发送

它们是一个图像链接,其有效性是有限的。


第二个可以帮助我知道图像是否已下载以及多少

次。


如何建立这样的下载链接?

我想要的信息是用户ID,日期时间限制和

图像文件,当然一切都必须加密到足以不让其他

人们创建新的链接。

在链接中设置日期时间限制允许我不要在数据库中保存这些信息

。到达链接脚本将自动检查

日期时间限制。


我知道如何显示图片,这很容易。现在如何让用户

自动下载图像?不显示图像,而是制作

他下载文件。


感谢您为此提供建议。


Bob

I''ve to build a website where the customer can buy an image. I''m thinking in
the 2 ways to let people get those images: receive them by Email or send
them an image link wich validity is limited in time.

The second may help me to know if an image has been downloaded and how many
times.

How to build such download link ?
The informations I''d like is the userid, the datetime limit and the
imagefile, off course everything must be encrypted enough not to let other
people create new links.
Putting the datetime limit in the link allow me not to save this information
in a database. Arriving in the linked script will automatically check the
datetime limit.

I know how to show the picture, that''s easy. Now how to make the user
download the image automatically ? not showing the image but instead making
him to "download" the file.

Thanks for advising me about this.

Bob

推荐答案

Bob Bedford写道:
Bob Bedford wrote:

我必须建立一个客户可以购买图像的网站。我想在

中让人们获得这些图像的两种方法是:通过电子邮件接收它们或发送

它们是一个图像链接,其有效性是有限的。


第二个可以帮助我知道图像是否已下载以及多少

次。


如何建立这样的下载链接?

我想要的信息是用户ID,日期时间限制和

图像文件,当然一切都必须加密到足以不让其他

人们创建新的链接。

在链接中设置日期时间限制允许我不要在数据库中保存这些信息

。到达链接脚本将自动检查

日期时间限制。


我知道如何显示图片,这很容易。现在如何让用户

自动下载图像?不显示图像,而是制作

他下载文件。


感谢您为此提供建议。


Bob

I''ve to build a website where the customer can buy an image. I''m thinking in
the 2 ways to let people get those images: receive them by Email or send
them an image link wich validity is limited in time.

The second may help me to know if an image has been downloaded and how many
times.

How to build such download link ?
The informations I''d like is the userid, the datetime limit and the
imagefile, off course everything must be encrypted enough not to let other
people create new links.
Putting the datetime limit in the link allow me not to save this information
in a database. Arriving in the linked script will automatically check the
datetime limit.

I know how to show the picture, that''s easy. Now how to make the user
download the image automatically ? not showing the image but instead making
him to "download" the file.

Thanks for advising me about this.

Bob



把它放在一个zip文件中?

Put it in a zip file?


Bob Bedford写道:
Bob Bedford wrote:

我''建立一个客户可以购买图像的网站。我想在

中让人们获得这些图像的两种方法是:通过电子邮件接收它们或发送

它们是一个图像链接,其有效性是有限的。


第二个可以帮助我知道图像是否已下载以及多少

次。


如何建立这样的下载链接?

我想要的信息是用户ID,日期时间限制和

图像文件,当然一切都必须加密到足以不让其他

人们创建新的链接。

在链接中设置日期时间限制允许我不要在数据库中保存这些信息

。到达链接脚本将自动检查

日期时间限制。


我知道如何显示图片,这很容易。现在如何让用户

自动下载图像?不显示图像,而是制作

他下载文件。


感谢您为此提供建议。


Bob
I''ve to build a website where the customer can buy an image. I''m thinking in
the 2 ways to let people get those images: receive them by Email or send
them an image link wich validity is limited in time.

The second may help me to know if an image has been downloaded and how many
times.

How to build such download link ?
The informations I''d like is the userid, the datetime limit and the
imagefile, off course everything must be encrypted enough not to let other
people create new links.
Putting the datetime limit in the link allow me not to save this information
in a database. Arriving in the linked script will automatically check the
datetime limit.

I know how to show the picture, that''s easy. Now how to make the user
download the image automatically ? not showing the image but instead making
him to "download" the file.

Thanks for advising me about this.

Bob



如果他们可以显示图像,他们已经下载了它并且可以保存它。


然而,你不能制造 ;他下载图像 - 这取决于

浏览器设置。所有你能做的就是建议下载图片;


要做到这一点,你的脚本需要检查时间限制,如果它是

合适的标题,即


标题(''Content-disposition:attachment; filename = image.gif'');

标题(''内容 - 输入:image / gif'');

readfile(''image.gif'');


-

==================

删除x来自我的电子邮件地址

Jerry Stuckle

JDS计算机培训公司
js ******* @ attglobal.net

==================

If they can display the image, they''ve already downloaded it and can
save it.

However, you can''t "make" him download the image - that''s up to the
browser settings. All you can do is recommend downloading the picture;

To do that, your script needs to check the time limit, and if it''s
within the appropriate headers, i.e.

header(''Content-disposition: attachment; filename=image.gif'');
header(''Content-type: image/gif'');
readfile(''image.gif'');

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================


把它放在一个zip文件中?


您好R0g,


感谢您的支持建议。


使用该网站的人可能已经足够遵循以下程序来下载图片(所有内容都有解释),但有些人可能无法 ;解压缩

文件。


理想情况下,脚本应显示另存为。消息,让人们保存

的文件。如果我不使用< IMGtag,那么该文件将被提议用于保存,不是吗?不是吗?或者我应该使用其他方式(也许是javascript)。


Bob
Put it in a zip file?

Hi R0g,

thanks for your suggestion.

People that use the site may be good enough to follow the procedure to
download images (everything is explained) but some may be unable to "unzip"
files.

Ideally, the script should show the "save as" message and let people save
the file. If I don''t use the <IMGtag, the file will be proposed for
saving, isn''it ? or should I use an other way (maybe javascript).

Bob


这篇关于创建限时下载链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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