Download dialog with unknown mime types
Posted: Tue Dec 17, 2002 1:29 pm
I am trying to force users to download a file.
Problems:
1. Mozilla opens the download dialog correctly, but appends ".php" to the filename.
2. IE does not open a dialog at all.
Below is my code.
$file_name="myfile.ext";
if(file_exists($file_name)){
session_cache_limiter("");
header('Content-type: application/octet-stream');
header('Content-Disposition: filename='.$file_name);
}
note: I have also tried (same problems occur)
header('Content-Disposition: attachment; filename='.$file_name);
Problems:
1. Mozilla opens the download dialog correctly, but appends ".php" to the filename.
2. IE does not open a dialog at all.
Below is my code.
$file_name="myfile.ext";
if(file_exists($file_name)){
session_cache_limiter("");
header('Content-type: application/octet-stream');
header('Content-Disposition: filename='.$file_name);
}
note: I have also tried (same problems occur)
header('Content-Disposition: attachment; filename='.$file_name);