Hello,
We are downloading files using code. It worked fine for all file types. However, for text (.txt) files the txt file would contain the code of aspx page appended to the txt file contents.
So we used the response.end() at end of the downlaod code (check below). Now what happens is that we are able to download txt files fine, but any error message does not get displayed on page.
Response.ContentType = getcontenttype(fileslistArray);
Response.AppendHeader("Content-Disposition", "attachment; filename=\"" + fileslistArray[0].Split('\\')[fileslistArray[0].Split('\\').Length - 1] + "\"");
Response.TransmitFile(serverlocation + fileslistArray[0].Split('\\')[fileslistArray[0].Split('\\').Length - 1]);
}
}
catch (Exception ex)
{
lblmessage.Text = "Error: " + ex.Messag ...
Go to the complete details ...