views:

116

answers:

2

Is there a way I can programmatically determine the status of a download in Chrome or Mozilla Firefox? I would like to know if the download was aborted or completed successfully.

For writing the code I'd be using either Perl, PHP or Python.

Please help. Thank You.

+1  A: 

I don't know about Chrome, but recent versions of Firefox keep the download records in a SQLite database (downloads.sqlite in your profile directory). I'm not sure if that gets updated while the download is in progress, but it should tell you the status once the download is complete/aborted.

cjm
A: 

There are scripts out there that output the file in chunks, recording how many bytes they've echoed out, but those are completely unreliable and you can't accurately ascertain whether or not the user successfully received the complete file.

The short answer is no, really, unless you write your own download manager (in Java) that runs a callback to your server when the download completes.

Andy E
This is incorrect. You can ensure that the client has received the data, as they've sent a TCP acknowledgement that they've received it.
Kristopher Ives
@Kristopher Ives: Then where's your answer? [Other Stack Overflow answers](http://stackoverflow.com/questions/1563187/check-if-download-is-completed/1563292#1563292) I've seen suggest that it can't be done, and even google is no help.
Andy E