pradeep
pradeep

Reputation: 11

How to download image from browser asp.net

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

Answers (1)

Samuel Neff
Samuel Neff

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

Related Questions