How to determine if a file is actually downloaded and saved, despite the browser prefetch / cache?

I am creating a script to save the download statistics, but I would only like to update the statistics if the file was downloaded CONSTANTLY.

The problem is that browsers (like Explorer 9, Chrome, ...) automatically start downloading the file while the save / open dialog is still open. This means that the file can be fully downloaded (to the pace directory you specify, which I assume) before the user indicates where to save it (or while Explorer still shows a yellow warning bar).

The user may decide to cancel the save even if the file was successfully downloaded. How can I tell browsers not to load automatically? Maybe some kind of HTTP header? Any other solutions?

+3
source share
3 answers

You cannot do what you want. This is not possible, at least not as you ask.

, , , script . , , , . . ( , , ). , , - .

, , , . , . , , . , .

, .

+3

, . - , .

, , - , , ( ).

0

, , ", ", .

, , PHP, Apache. PHP readfile PHP . , readfile, flush . , . , readfile , .

, , , , "" tempfile.

0

All Articles