2
Reply

Downloaded files get corrupted

Mohit Kapoor

Mohit Kapoor

Mar 5 2017 11:14 AM
257
Files are successfully uploaded in the Local folder but while downloading files get corrupted (dosen't open)
 File uploaded successfully !
 
Code to download(for image file):
 
Response.Clear();
Response.ContentType = "image/jpeg";
Response.AppendHeader("Content-Disposition", "filename=" + e.CommandArgument + " ");
string filename = e.CommandArgument.ToString();

Response.TransmitFile(Server.MapPath("~/admin/notices/") + filename);

Response.End();
 

Answers (2)