Downloading a file.

From: Date: Wed, 11 Jun 2003 15:44:34 +0000
Subject: Downloading a file.
Groups: php.general 
Request: Send a blank email to php-general+get-151092@lists.php.net to get a copy of this message
Hello, To download a file after a form like that: <form name="download" action="downloadit.php" method="post"> Do you want to download....? </form> 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 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 :( 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.

« previous php.general (#151092) next »