Hello:
I'm using PHP on Apache/Linux and readfile() to download 4-7MB wma files from my server:
//download.php
// define $filesize, $filename, and $fullpath
header("Content-Type: application/octet-stream");
header ("Content-Length: ".$filesize);
header( "Content-Disposition: attachment; filename=" . $filename);
header ("Content-Description: Windows Media Audio File");
readfile($fullpath);
i have a script (index.php) which prints different info depending on which functions are being executed - some functions print normal text, other functions print links to download.php which is what initiates the downloads using the appropriate headers, etc. (code snippet above)
it's working fine, except for 2 things:
1) when a file is being downloaded (through download.php), the user cannot load the index.php with another (or the same) function until the download ends. strange, huh? as soon as the download completes, the page loads.
2) when a file is being downloaded, the user cannot start another download until the 1st one stops. If the user clicks on another link to download.php, s/he gets a "Getting File Information..." dialog box until the 1st one is complete, then the normal "save as..." dialog box appears correctly. I assume this is because the download.php readfile is "tied up", but it seems a new request should be fine.
you can see what i mean on my site: weedfiles.com. click on a music genre on the upper left and then choose an artist, and try downloading 2 songs simultaneously.
any ideas would be appreciated. thanks so much!! you guys rock! :p