Mohit Kapoor

Mohit Kapoor

  • 1.6k
  • 94
  • 20k

Downloaded files get corrupted

Mar 5 2017 11:14 AM
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)