Search code examples
vb.netcontent-typesystem.drawingpage-title

How to set Page title for page with content type "image/jpeg"


I created a page GetImage.aspx of ContentType="image/jpeg" that displays an image.

Page.Response.ContentType = "image/jpeg"
Page.Response.Flush()

However, when I download the image, the image is saved as "GetImage.jpg". Is there a way where I can change the title of the saved image without having to create another page with a different name?

In other words, how to set page titles for pages of ContentType="image/jpeg"?


Solution

  • You can do it with content disposition.

    Response.AddHeader("content-disposition", "attachment;filename=somefile.name")