I try to delete file after download file.My code is
private void DownloadZipFileDialogue(string strZipFilePath)
{
Response.ContentType = "application/octet-stream";
Response.AppendHeader("Content-Disposition", "attachment; filename=" + Path.GetFileName(strZipFilePath));
Response.TransmitFile(strZipFilePath);
Response.End();
//File.Delete(strZipFilePath);
}
I know after Response.End();
no code block is execute.If i try to delete file befor Response.End();
zip file is corrupted.I search every where.I try:ApplicationInstance.CompleteRequest();
insteadof
Response.End();
.
But i get same result.zip file is corrupted.I see this Is Response.End() considered harmful? but unable to find solution.Any idea to solve the problem.Thanks.