Hi, I know this has been asked recently, but it doesn´t work for me...
What I want is to force the browser to save file types that would normally be displayed. In my case, .jpg-files.
And that seems to be a problem. I tried this code that was posted in the other discussion on the same topic:
<?
$filename="frame1.html";
$mimetype="mime-special";
header("Content-type: $mimetype");
header("Content-Disposition: attachment; filename=$filename");
header("Content-Description: PHP3 Generated Data");
header("Pragma: no-cache");
header("Expires: 0");
include($filename);
?>
It works fine with .html and .txt-files. for example, but any pictures (.jpg & .gif) are truncated, means the files that arrive on my harddisk are smaller than the real ones. E.g. one .jpg-file of 20kb was only 8kb when I downloaded it using the above script from the webserver running on my very own system. When I tried a server on the net it was 0kb... Needless to say, the files could not be opened.
Any ideas about this? Am I just to retarded to copy&paste code and exchange a single filename???