Download script shows filename.ext.php
Posted: Mon Nov 10, 2003 12:14 am
I am using following code for downloading files. Its working fine in IE. But in Netscape while saving the file. in the file dialog, it shows filename.ext.php. How to remove this ".php" from the saveas file name.
--------------------------------------------------------------------------------------
header("Content-Type: $type");
header("Content-Disposition: attachment; filename=\"" . $file_name . "\"");
header("Content-Length: " . filesize ($download_this));
header("Content-Transfer-Encoding: binary");
fpassthru($fp);
$fd = fopen($download_this ,'r');
$contents = fread ($fd, filesize ($file_name));
echo $contents;
fclose ($fp);
-------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------
header("Content-Type: $type");
header("Content-Disposition: attachment; filename=\"" . $file_name . "\"");
header("Content-Length: " . filesize ($download_this));
header("Content-Transfer-Encoding: binary");
fpassthru($fp);
$fd = fopen($download_this ,'r');
$contents = fread ($fd, filesize ($file_name));
echo $contents;
fclose ($fp);
-------------------------------------------------------------------------------------