Hi,
I'd like to use a php page as a proxy in order to download a file.
My question is, how do I go about ensuring that the entire file has been downloaded.
i.e. if the user cancels the download half way through I need to know.
file download monitoring (possible?)
Moderator: General Moderators
-
thehustler
- Forum Newbie
- Posts: 2
- Joined: Wed Jul 20, 2005 3:16 pm
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
- IceMetalPunk
- Forum Commoner
- Posts: 71
- Joined: Thu Jul 07, 2005 11:45 am
I would do something like this:
This way, the part where the comment is can only be reached once all the data has been transferred.
-IMP

Code: Select all
<?php
$filename="http://www.somedomain.com/somefile.ext";
$data=file_get_contents($filename);
$mime=mime_content_type($filename);
header("Content-type: $mime");
echo $data;
/*Since we got to this point, the file should be done, so do whatever you want here.*/
?>-IMP
-
thehustler
- Forum Newbie
- Posts: 2
- Joined: Wed Jul 20, 2005 3:16 pm
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia