Hello,
I am trying to serve files through PHP for only authenticated users. Files are stored in a different path and the website is on the different path
Say filepath is /filepath
and webpath is /webpath
My script works fine. I am using the following code to serve file. I am only putting a cross section over here
<?
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"filename\"");
header("Content-Length: filesize");
readfile(/filepath);
?>
Now the problem is with the multiple downloads. Say a user types
/webpath/phpfile?file=file1
and then immediately types
/webpath/phpfile?file=file2
The file2 with not start downloading until file1 has downloaded or the file1 download has been cancelled. This problem I faced both with IE and Firefox.
Thinking it to be a browser problem, I also tried URL rewriting technique, where in /webpath/files, I made a .htaccess with following
RewriteEngine On
RewriteRule .*$ filehandler.php
So now the webpath became /webpath/files/file1. Even in this case file2 would'nt download until the file1 has downloaded.
Any suggestions or ideas.
Bye
Kirti