473,691 Members | 2,374 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Create limited time download link

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
Sep 23 '08 #1
12 4015
r0g
Bob Bedford wrote:
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

Put it in a zip file?
Sep 23 '08 #2
Bob Bedford wrote:
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
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*******@attgl obal.net
=============== ===

Sep 23 '08 #3
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
Sep 23 '08 #4
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');

--
Hi Jerry,

thanks for your suggestion. I've to do a "you can't do simple" way. Most
people don't know how to do a "right click" and then "save as". Also Mac
users don't have a "right" button.
Also I can't ask people to change their settings. Ideally the script should
propose the file as "save as...".

Bob
Sep 23 '08 #5
Hi Bob,

I think that you'll find this comment helpful: It looks like a pretty
bulletproof way to force a file download, just tweak it to work with
these images rather than .xls files.

http://us2.php.net/manual/en/function.header.php#83384

Thomas

On Sep 23, 1:24*pm, "Bob Bedford" <b...@bedford.c omwrote:
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
Sep 23 '08 #6
Bob Bedford wrote:
>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('Conten t-disposition: attachment; filename=image. gif');
header('Conten t-type: image/gif');
readfile('imag e.gif');

--
Hi Jerry,

thanks for your suggestion. I've to do a "you can't do simple" way. Most
people don't know how to do a "right click" and then "save as". Also Mac
users don't have a "right" button.
Also I can't ask people to change their settings. Ideally the script should
propose the file as "save as...".

Bob
The code I gave you is the best you're going to do. You can't force it;
you can only recommend. And that's what the code does.

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

Sep 23 '08 #7
Hi Thomas
>"703designs " <th**********@g mail.coma écrit dans le message de news:
0b************ *************** *******@k7g2000 hsd.googlegroup s.com...
Hi Bob,

I think that you'll find this comment helpful: It looks like a pretty
bulletproof way to force a file download, just tweak it to work with
these images rather than .xls files.

http://us2.php.net/manual/en/function.header.php#83384
Great source, this is exactly what I were looking for.

Thanks a lot !

Bob

Sep 23 '08 #8
Hi Jerry,
The code I gave you is the best you're going to do. You can't force it;
you can only recommend. And that's what the code does.
....and that's why I'm gratefull about your help, that I appreciate a lot.

Thank you.

Bob
Sep 23 '08 #9
On Sep 23, 12:47*pm, Jerry Stuckle <jstuck...@attg lobal.netwrote:
Bob Bedford wrote:
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

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.
jstuck...@attgl obal.net
=============== ===- Hide quoted text -

- Show quoted text -
Jerry

I just noticed the part about the header, this may resolve an issue I
have been having streaming images out. I want to set the mime type in
the header and also send the size so Flash knows how big it is, but it
would never let me do more than one "content" in the header tag. I
tried seperating them with "\n" like I would do in perl, but now,
after seeing what you posted, it dawned on me that you can use
multiple header()'s instead of combining them into one. Is that so?

Bill H
Sep 23 '08 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
18794
by: Martin | last post by:
I have a situation where I'm displaying some information in a table on a web page. I've given the user the ability to make several different "queries" and show different sub-sets of the data. I would like to add a button to the page that would allow the user to create an .XLS file that would contain the current contents of the table. I realize that I could create it on the server and allow him to download it but I'd rather let him create...
1
3300
by: Sebastian C. | last post by:
Hello everyone I just found at the adress below Microsoft Access Run Time. It says that this is Access Run Time :Alternative Version. There is nothing about who can download or install this version. http://www.microsoft.com/downloads/details.aspx?FamilyID=0c8f40ca-9ecc-426a-ac5f-e1f98a6acd73&DisplayLang=en It can be downloaded. I downloaded and install it and it works just
8
4511
by: Ted Miller | last post by:
Hi folks, I'm looking at moving a large base of C++ code to .Net under tight time constraints. The code runs in mission-critical environments, and I am extremely concerned about the loader lock problem and the potential for deadlocks. After pouring over the available information, and trying a few experiments, I am still left with a few questions and issues I hope someone out there can shed some light on.
4
7297
by: Asaf | last post by:
Hi, Is there a way to create a temporary download link and to know when the client has finished downloading the file? Thanks in advanced,
11
3429
by: mesut demir | last post by:
Hi All, When I create fields (in files) I need assign a data type like char, varchar, money etc. I have some questions about the data types when you create fields in a file. What is the difference between data type 'CHAR' and 'TEXT'? When do you use 'VAR' in your datatype word? e.g. VARCHAR ?
6
3678
by: windandwaves | last post by:
Hi Folk Some of my clients asked me to create "fancy emails" for them (aka html formatted emails). I know how to make a nice html document, but I had trouble creating a simple way to provide the document to my clients so that they could use it to. I know most of them use Outlook XP or Outlook 2003, so what I created was a page that creates a Visual Basic script that, when saved to the desktop and
5
5805
by: nephish | last post by:
Hello there, i have an app that i need to be able to publish a link to download a csv file. i know that i can use php to make the file, but how to i link to it through php. like if i have an html file that has a link in it like this <a href="somedata.csv">here be data</a> or would i make that a .php file that would generate a csv ?
5
7621
by: moondaddy | last post by:
I want to create a custom UI element which will be a custom rectangle object in a c# XAML application. I'm new to XAML and c# as most of my experience has been using vb with sql. I'm building a simple Visio type app where I can drag rectangles on a canvas to create diagrams. for now I don't need fancy shapes so I'll just start with a rectangle class where I can add custom properties to it such as where lines are connected to it, etc. ...
0
8599
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8531
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8951
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
6457
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4322
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4550
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2965
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2227
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1952
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.