Click to See Complete Forum and Search --> : Instead of opening a JPG image let the user DL it...???


Gremlins
07-18-2003, 06:41 AM
I have a lil problem, i need to let the user download JPG images instead of just viewing them in a browser window.
A normal tag:
<a href="images/001.jpg"><img src="mini/mini001.jpg"></a>
does not work for me!!!
I need the browser to give me the standard POP UP asking if the user wants to OPEN the file or SAVE IT TO DISK.
if you got the answer help me out pleeeeeease!

DaveSW
07-18-2003, 07:10 AM
have you read this thread?

http://forums.webdeveloper.com/showthread.php?s=&threadid=13220

it may contain your answer

Gremlins
07-18-2003, 07:19 AM
can't make it work, and anyway trying not to use php

DaveSW
07-18-2003, 07:40 AM
can't zip it?

Gremlins
07-18-2003, 07:44 AM
and additionally the image is in CMYK so it cannot open in Explorer or netscape so someone can just drag and drop, or use "save image as"

Da Warriah
07-18-2003, 08:44 AM
your best bet would be to zip it....but if youre totally against that, the next easiest way would be to change the file extension...change it to something like .gremlin, so you can be sure the browser wont recognize it as a known filetype and try to open it...then the user downloads it and changes the extension back to .jpg....its primitive, but itd work...;)

Gremlins
07-18-2003, 09:40 AM
trust me i'd like to but that's just not possible in this case, needs to be with a jpg extention

pyro
07-18-2003, 11:07 AM
There are two ways to force a download.

1: set the file extention to something that a browser can't display... (the .zip method)

2: use a server-side language (as Dave linked to above) to set the headers, and force the browser to download the file.