i have the following headers integrated w/ some some of my variables. It's a common script that uses headers to send out information to download a file:

header ( "Expires: Mon, 26 Jul 1997 05:00:00 GMT" ); 
header ( "Last-Modified: ".gmdate ( "D, d M Y H:i:s" )."GMT" ); 
header ( "Pragma: no-cache" ); 
header ( "Cache-Control: no-store, no-cache, must-revalidate" ); 
header ( "Cache-Control: post-check=0, pre-check=0", false ); 
header ( "Content-Type: application/download" ); 
header ( "Content-Disposition: attachment; filename=".$download_filename."" ); 
header ( "Content-Transfer-Encoding: binary" ); 
header ( "Content-Length: ".$download_filesize."" );

now, this works really well with all browsers BUT my problem is this. Lets say im downloading a file using this method and i click the link again to download another file. FOR IE, this works and i can download as many files as i want BUT with other browsers like FIREFOX and NETSCAPE, i can only download one file at a time. While im downloading, if i click to download, it doesn't do anything. However, if im done the download, THEN i can download again. This is a very annoying problem b/c i would like to download multiple files at a time for ALL browsers. I think the problem lies in my headers but im not sure what to change. ANY ANY help is appreciated. Thank you.

    Why don't you try to make things simpler ?

    header ( "Content-Type: application/download" ); 
    header ( "Content-Disposition: attachment; filename=".$download_filename."" );

    It's what I use to make some files downloadable.

      that still doesn't solve the problem w/ Firefox and Netscape. It still will only let me download one file at a time. If im downloading a file and i run the script and try to download another one, it just does nothing. Only AFTER the download is finished or cancelled, does the download popup come up again. If anyone can help, it'd be appreciated.

        I don't really see why Firefox couldn't handle it, I use Firefox everyday. The problem is that multiple downloads mean multiple script execution, but I don't understand why the application server would work for IE and not for Firefox. Does your web server run under IIS or Apache ?

        Can you provide us with page and script samples so we can try it ?

          i think the server uses apache, but its my friends server so not 100% sure. the sample link is here:
          http://animereporter.com/download

          click the link and download the file, and once your downloading, click again. You will notice that in IE you can keep downloading, but for Firefox and Netscape it doesn't. Help is appreciated.

            Originally posted by tommychi
            i think the server uses apache, but its my friends server so not 100% sure. the sample link is here:
            http://animereporter.com/download

            click the link and download the file, and once your downloading, click again. You will notice that in IE you can keep downloading, but for Firefox and Netscape it doesn't. Help is appreciated.

            Sample file is 1KB large, I can't click the link twice, download is too fast. Did you try to download the file without using the PHP script ? Direct download. There's no reason for Firefox to freeze when downloading.

              the sample file is 1 kb? That can't be right.. I just tried it right now and it downloads perfectly.. The filesize should be around 3 megs. As for having it direct download, the whole point of doing this is so i can avoid direct download - this is in order to lessen down on bandwidth and also so people dont find the original link. Try again, b/c the download works fine for me - That is except for that 1 file at a time only problem on Firefox and nEtscape.

                Well, I got the larger file without any trouble (Mozilla 1.6); as for the "multiple files" problem, I couldn't test that: there was only one file offered for download, and Mozilla wasn't going to waste time requesting the same file the dozen times I requested it.

                PS: the correct MIME type is "application/octet-stream":

                RFC2046
                The "octet-stream" subtype is used to indicate that a body contains arbitrary binary data.

                  Write a Reply...