"open or save " a jpg file

V

viza

Hi
I'd like to make the same thing as in flickr.com: a link that, if
clicked, doesn't open the jpg file, but asks if open or save it.

You need to get your server to send a

Content-Disposition: attachment

header. The way this is done depends on your server. If you are using
apache 2, you need to add eg:

<Files *.jpg>

header set Content-Disposition attachment

</Files>

to the appropriate .htaccess file.

If you have not got permission to write to .htaccess, then you can still
botch it using php.

http://php.net/manual/en/function.header.php
http://php.net/manual/en/function.readfile.php
 
A

Andy Dingley

Thanks for reply. I know ASP only, how could i do that with ASP?

Response.AddHeader('Content-Disposition: header stuff... ');

do it before you send _any_ of the content back
 
D

dorayme

"Giorgio said:
Hi,
I'd like to make the same thing as in flickr.com: a link that, if clicked,
doesn't open the jpg file, but asks if open or save it.

http://farm1.static.flickr.com/207/528622103_3a5c51e32b_o_d.jpg (asks if
open or save)

This did not ask me anything. It just brought up my download OS
window (not browser), downloaded something and some image
software (set by me to open such files generally when I click on
..jpg in my file system) fired up and opened a pic of pups etc...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top