HTTP download with resume
Posted: Mon Jul 29, 2002 5:37 pm
I've written a script to handle downloading of files over HTTP (as attachments). The idea being that I have download URLs on my site, but rather than them linking directly to the actual files, they all reference my script and pass in a file identifier. I am doing this in order to have auditing and authentication incorporated into the download process.
Everything works fine. The problem is that when using my script, it screws up the web servers ability to handle partial downloads. Consequently download managers like GetRight can't resume broken downloads. Linking directly to the files, without my script in the way, downloads can be resumed as normal.
The script sends these headers:
header("Content-Type: application/octet-stream");
header("Content-Length: " . (string)$aTrack->size);
header("Content-Disposition: attachment; filename=\"" . $aTrack->getOrigFileName() . "\"");
Then dumps the content of the file into the HTTP stream.
Does anyone have any ideas how I can pursuade the web server (IIS5.0) to allow range based HTTP requests, whilst still using my script?
Thanx.
Everything works fine. The problem is that when using my script, it screws up the web servers ability to handle partial downloads. Consequently download managers like GetRight can't resume broken downloads. Linking directly to the files, without my script in the way, downloads can be resumed as normal.
The script sends these headers:
header("Content-Type: application/octet-stream");
header("Content-Length: " . (string)$aTrack->size);
header("Content-Disposition: attachment; filename=\"" . $aTrack->getOrigFileName() . "\"");
Then dumps the content of the file into the HTTP stream.
Does anyone have any ideas how I can pursuade the web server (IIS5.0) to allow range based HTTP requests, whilst still using my script?
Thanx.