I didn't really read much of this but it seems to be related to what you are trying to do. The trick obviously is to force a download and save-to-disk of the image as apposed to it just being displayed in the browser.
After some investigation, I resolved this by copying the Handler.ashx file and adding some additional lines to ensure that the Save dialog appeared.
Then I amended the href tag to link to the new ashx file passing the PhotoID and Caption information.
Clicking the 'Download Photo' image then displays the Save dialog and the default filename is the Caption information.
This was the only addition needed to ensure that the ashx file produced the Save dialog :-
dtharby
Member
206 Points
42 Posts
How do you change 'download photo' button to produce Save File dialog ?
Sep 19, 2006 11:51 AM|LINK
Hi All,
Have searched for some help on this across the forum but nothing appears to be concrete in advice.
I want to amend the 'Download Photo' button/image so that it generates the Save dialog rather than displaying the picture in full glory.
However as I am using the database method to store my photos, is this possible.
Thanks for any assistance in advance
Dan
jwadsworth
Contributor
2378 Points
542 Posts
Re: How do you change 'download photo' button to produce Save File dialog ?
Sep 20, 2006 10:18 PM|LINK
I didn't really read much of this but it seems to be related to what you are trying to do. The trick obviously is to force a download and save-to-disk of the image as apposed to it just being displayed in the browser.
http://psacake.com/web/if.asp
Extended Personal Site Starter kit
dtharby
Member
206 Points
42 Posts
Re: How do you change 'download photo' button to produce Save File dialog ?
Sep 21, 2006 06:41 PM|LINK
Thanks for the pointer ...
After some investigation, I resolved this by copying the Handler.ashx file and adding some additional lines to ensure that the Save dialog appeared.
Then I amended the href tag to link to the new ashx file passing the PhotoID and Caption information.
Clicking the 'Download Photo' image then displays the Save dialog and the default filename is the Caption information.
This was the only addition needed to ensure that the ashx file produced the Save dialog :-
context.Response.AddHeader("Content-Disposition", "attachment; filename=" & context.Request.QueryString("Caption") & ".jpg")and the HREF tag :-
Hope this helps anyone else that wishes to do this....
Rgds
jwadsworth
Contributor
2378 Points
542 Posts
Re: How do you change 'download photo' button to produce Save File dialog ?
Sep 21, 2006 09:36 PM|LINK
download save dialog
Extended Personal Site Starter kit