Sometimes we don't want users to open known types of files directly in IE, such as Word, and hope to download directly, at this time, you can use the following code to replace Response.Redirect
Response.ContentType = "application / octet-stream"; Response.AddHeader ( "Content-Disposition", "attachment; FileName =" YourFileName); Response.BinaryWrite ((byte []) YourFileData.Rows [0] [ "AttachmentContent "]); Response.end ();