views:

46

answers:

1

I have a series of images stored in a MySQL database that I am displaying with a .NET Http handler (showImage.ashx). If the user right clicks on an image and selects "save image as...", the image name always defaults to 'showImage.jpg'. I have potential image names saved in the database, is there any way to control the default save name of an image through the http handler?

Adding a Content-Disposition header was the solution, thanks so much!

HttpContext.Current.Response.AppendHeader("Content-Disposition","filename=" + fileName + ";");
+3  A: 

You need to add a Content-Disposition header, like this:

Content-Disposition: filename=Something.jpg
SLaks