Checking on completed downloads

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
welly
Forum Newbie
Posts: 5
Joined: Mon Jan 21, 2008 3:34 pm

Checking on completed downloads

Post by welly »

Hi guys,

I'm new to the forum, so "hi!", but I have a question regarding a site I'm working on. Essentially it allows users to search for a video and then add it to a download queue and download the file. I want to check for two things - that a file is being currently downloaded and that a file has completed downloading. This is so the user can't download more than one file at once (the site distributed VERY large movie files and I don't want to kill the bandwidth available!) and then the completed file can be removed from the queue.

Does anyone have any suggestions on how this can be done? I've been looking at the cURL library but not sure that's suitable for what I need to do. Downloads will be done over HTTP.

Thanks in advance,

Welly
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Checking on completed downloads

Post by Christopher »

Welcome. I suppose a simple way to track this is to just save some sort of status data about the download in the session when it starts, and then clear it when the download is done. You may need to tell the process to complete even if the user aborts so you can clear the status in that case.
(#10850)
welly
Forum Newbie
Posts: 5
Joined: Mon Jan 21, 2008 3:34 pm

Re: Checking on completed downloads

Post by welly »

That's the thing I'm looking for, finding out when the download is complete or aborted :) Everything else is fine! I'm currently just setting the header to prompt the user to download the file but after that, I've absolutely no idea on how to fire an event or other that recognises a completed or aborted download.

Welly
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Checking on completed downloads

Post by Christopher »

(#10850)
Post Reply