Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check if Download Complete?

Status
Not open for further replies.

colep

Programmer
Joined
Jul 18, 2002
Messages
58
Location
US
I am building a site where we are selling a program online. The user has the choice of downloading it or having the cd sent to them. My question is beings the user can only download the program once, how do I check to see that the download has been completed?? If anyone can help me on this, I would greatly appreciate it!!

Thanks in advance,
Cole ;)

 
As I see it, if PHP needs to keep track of a user's downloads, you're going to have to put PHP in the download stream.

Instead of providing a link to a file on your server's filesystem, provide a link to a PHP script that streams the file out to the customer.

Some "gotchas" that come to mind: On slow connections, you may run afoul of the PHP runtime directive max_execution_time. Depending on how you write the script, you may also run into resource limits.


Another way might be to provide your customers with access to the file for a specific period of time, say 8 hours.

You can then just make a copy or a link to the file available on the filesystem and let your web server stream the file. Then write a script that can be run periodically which removes files in that directory that are older than 8 hours.

Want the best answers? Ask the best questions: TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top