Making an image downloadable |
Making an image downloadable |
Jul 14 2007, 11:44 PM
Post
#1
|
|
![]() Senior Member ![]() ![]() ![]() Group: Member Posts: 50 Joined: Jul 2007 Member No: 541,260 |
Anyone know a code for making an image (or text) downloadable when you click it? Not a zip file ...just a regular download that saves to the computer
|
|
|
|
![]() |
Jul 19 2007, 11:15 PM
Post
#2
|
|
|
Senior Member ![]() ![]() ![]() ![]() Group: Member Posts: 122 Joined: Feb 2005 Member No: 106,057 |
There is a way to do it, and it involves either PHP / some sort of server side scripting or a server setting, which I'd doubt your host would allow. Personally I usually work with ASP, so I don't know the exact syntax for PHP, but look through the PHP reference for setting something called the MIME type. If you can have the php file send the image file (so your image is downloaded directly by the php file, such as image.php?image=thingy.jpg without any redirects or html), set the MIME type to "application/octet-stream". Additionally, you'll also need to set the content-disposition header, as described here: http://support.microsoft.com/kb/260519 (doesn't show PHP syntax, though).
A simpler way would be to have a server setting so that all jpeg files in, say, the "downloads" folder will automatically have the MIME type and content-disposition header set as described above. I wish I could give you a more specific example, but unfortunately I'm not much of a PHP coder =( |
|
|
|
miiszxclassiic Making an image downloadable Jul 14 2007, 11:44 PM
SinfullySweet Upload your file to any number of file hosting sit... Jul 15 2007, 12:42 AM
twilightsamurai Well usually if it's on a hosting site or anyt... Jul 15 2007, 01:00 AM
tripvertigo no, just LINK the image, in an anchor tag (<a h... Jul 15 2007, 02:12 PM
LovelyObsession QUOTE(tripvertigo @ Jul 15 2007, 03:12 PM... Jul 15 2007, 03:07 PM
miiszxclassiic yeh i know all that already I was trying to get ar... Jul 15 2007, 07:28 PM
ExtremeGimp If you set up the targets for the links right they... Jul 15 2007, 10:07 PM
tripvertigo theres just no reason to be using php and iframes ... Jul 16 2007, 11:18 AM![]() ![]() |