clh22793 Posted April 25, 2007 Share Posted April 25, 2007 How can I use php to detect whether or not a file has been downloaded successfully? I'm storing files in a mysql database, and need to process some code once a file has been downloaded successfully. Any ideas? Quote Link to comment Share on other sites More sharing options...
benjaminbeazy Posted April 25, 2007 Share Posted April 25, 2007 downloaded or uploaded?? Quote Link to comment Share on other sites More sharing options...
clh22793 Posted April 25, 2007 Author Share Posted April 25, 2007 downloaded...from the database to user desktop for example. Quote Link to comment Share on other sites More sharing options...
btherl Posted April 25, 2007 Share Posted April 25, 2007 It's very difficult to detect from the server side, particularly if the user resumes the download. The thing is, even if you send out the file, you don't know for 100% if the user got it or not. If you have all your downloads go through a script then you can at least track the number of download attempts. If it's critical that the user receives the complete file, there are two main options i can think of 1. Have the user tell you that they received the file. 2. Allow re-downloading of the file in case the first attempt fails, giving the user a chance to complete the download. Then assume that if they don't try again within some specified time period, they probably got the file. Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted April 25, 2007 Share Posted April 25, 2007 Many sites that provide files for download also provide an MD5 hash of the file so those inclined can ensure they do indeed have an uncorrupted file. Those not inclined won't give a flying rats backside and will just download again or think it was all garbage and leave. There is an possible option discussed here... http://www.expertsrt.com/tutorials/Rod/JSread.php but in all honesty I see very little to be gained from it and you are simply making more work foryourself that will very rarely be utilized (if at all.) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.