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");

LEAVE A REPLY

Please enter your comment!
Please enter your name here