Re: [WSG] Downloading images, not viewing them

2007-01-21 Thread Nick Fitzsimons

On 21 Jan 2007, at 18:00:14, Mark Stickley wrote:


Hi guys,

I am trying to make a feature where a user can click a link to  
download an image. The trouble is of course that the image loads  
into the browser. Does anyone know of a way to force a download of  
an image rather than the behaviour I've been experiencing? I'd  
rather not have to include text instructing the user on how to  
right click etc as it kind of messes with the layout...




You can use the Content-Disposition header to tell the browser to  
save the file rather than displaying it:


Content-Disposition: attachment; filename="someImage.png"

although there are some issues with older versions of IE Win, as  
described at



There's a more detailed explanation of the process at


HTH,

Nick.
--
Nick Fitzsimons
http://www.nickfitz.co.uk/





***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] Downloading images, not viewing them

2007-01-21 Thread Horst Gutmann
Mark Stickley schrieb:
> Hi guys,
> 
> I am trying to make a feature where a user can click a link to download
> an image. The trouble is of course that the image loads into the
> browser. Does anyone know of a way to force a download of an image
> rather than the behaviour I've been experiencing? I'd rather not have to
> include text instructing the user on how to right click etc as it kind
> of messes with the layout...
> 
> Thanks!
> 

You could send it with a generic content type like application/octet-stream

Best regards,
Horst



***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



[WSG] Downloading images, not viewing them

2007-01-21 Thread Mark Stickley

Hi guys,

I am trying to make a feature where a user can click a link to  
download an image. The trouble is of course that the image loads into  
the browser. Does anyone know of a way to force a download of an  
image rather than the behaviour I've been experiencing? I'd rather  
not have to include text instructing the user on how to right click  
etc as it kind of messes with the layout...


Thanks!


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***