RE: [PHP] Forcing Download of a .jpg file in IE
| From: | Mark Lipscombe | Date: | Thu, 30 Nov 2000 06:42:44 +0000 |
| Subject: | RE: [PHP] Forcing Download of a .jpg file in IE | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-27984@lists.php.net to get a copy of this message | ||
The correct way to ask a browser to offer to save the file for the user,
rather than display it inline, is via the Content-Disposition header
(RFC2183).
You would do it like this:
Header ("Content-Type: image/jpeg");
/* Content-Length is not necessary, but if you supply it, the user will see
how
* big the file is, and, presumably, how far they are into the download */
Header ("Content-Length: " . $contentlength);
Header ("Content-Disposition: attachment; filename=suggestedfilename.jpg");
readfile("myimage.jpg");
Hope this helps.
Cheers,
Mark
-----Original Message-----
From: kansast@mac.com [mailto:kansast@mac.com]
Sent: Thursday, 30 November 2000 5:09 PM
To: php-general@lists.php.net
Subject: [PHP] Forcing Download of a .jpg file in IE
Sorry to ask this, because I know it's been discussed probably in detail in
the mailing list. I have tried to search, and collect notes on this but have
yet to find a solution, and now I'm under a tight deadline.
I'm wanting to provide a link on a web page, which would force a user's
browser to download a .jpg file specifically a user running IE 5 on the
MacOS.
currently I have a solution which works in other browsers, and if I change
the preferences in IE 5 on the MacOS I can get it to work. But the client
doesn't like that option.
Any suggestions would be appreciate.
kansas
kansat@mac.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net