Welcome to Comunidade Bloggers |create|it| Sign in | Join | Help
Setting the original file name when using Response.BinaryWrite()

Imagine you have file saved in a database. Then you have an aspx page that gets that page and sends it back to the user.

If you just simply use Response.BinaryWrite you get the browser's download dialog box and the file's name will be the aspx page's name. If you want to force the original file name you have to add an header to the response like this:

Response.AddHeader("Content-Disposition", "inline;filename=ORIGINAL_FILENAME");

Posted: Thursday, November 16, 2006 9:15 AM by ricardo.costa
Filed under: ,

Comments

No Comments

Anonymous comments are disabled