Last post Sep 21, 2006 05:36 PM by jwadsworth
Sep 19, 2006 07:51 AM|dtharby|LINK
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
Sep 20, 2006 06:18 PM|jwadsworth|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.
Sep 21, 2006 02:41 PM|dtharby|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 :-
<a href='DownloadFile.ashx?PhotoID=<%#Eval("PhotoID")%>&Caption=<%# Eval("Caption") %>'>
Hope this helps anyone else that wishes to do this....
Sep 21, 2006 05:36 PM|jwadsworth|LINK
download save dialog