Reputation: 11
Is there any way i can download image using asp.net
I want to dialog box opened to save it
Thanks
Upvotes: 0
Views: 4851
Reputation: 74949
Create a link to a download page like this:
Download.aspx?Image=whatever.jpg
and then in Download.aspx set the content headers:
Response.ContentType = "image/jpeg";
Response.AddHeader("Content-Disposition", "attachment; filename=whatever.jpg");
The browser will display a save dialog instead of displaying it.
Upvotes: 3