On Jun 11, 2003, "Alex Earl" claimed that:

|>
|> If he wants to download, in the file downloadit.php, there is:
|> header("Content-type: application/octet-stream\n");
|> header("Content-Disposition: attachment; filename=mysoft-1.0-truc.zip");
|> header('Cache-Control: public');
|> header("Content-transfer-encoding: binary\n");
|> header("Content-length: " . filesize($path) . "\n");
|> $fp=fopen($path, "r");
|> fpassthru($fp);
|>
|> But, with IE, it saves the file with [] as:
|> mysoft-1.0[1]-truc.zip
|> And with Netscape 7.x, it saves the file with the .php extension:
|> mysoft-1.0-truc.zip.php
|>
That seems to be a Netscape/Mozilla "feature." It seems to always save the
file with the source file's extension. I have the same issue sending a
data that should be a .csv file ending up as a .csv.cgi.


|> Does anyone know what to do to make it saved as: mysoft-1.0-truc.zip
|>
|> And I would like to display a page telling "Thanks for download" or
|> something...but if I had to the end:
|> header("Location: http://www.mywebsite.com/thanks.html";) ;
|> I does not work :(

header("Location:..."); must not be sent after any html, so you won't be
able to redirect that way.

|>
|> Does anyone know how change the location and is there is anyway to know
|> if the download has been perfomed 'till the end...
|>
|> Thanks,
|> Vincent.
|
|There is no way to tell if the download completes, I don't think, that is
|a client side thing that if you send the content-length header it should
|know if the file downloaded successfully or not, the browser does not send
|a "success" signal back. Also, if you put quotes around the filename in
|the Content-Disposition header, it will save the file with the exact
|filename you specify, the RFC doesn't specifiy that it has to be this way,
|but I have found that putting quotes around it makes it work for pretty
|much any browser I have tried.
|

Perhaps if you know approximately how much time it takes to download the
file, you can use a <meta http-equiv="refresh"...> to redirect to a
"thanks for downloading" page, with a link back to the download.

Jeff
-- 
Registered Linux user #304026.
"lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import"
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to