I am getting above exception when running the application in prod server. I never get that exception in dev and in test environment.
Could any please help me out. If there is anything wrong in the code.
Could any please help me out. If there is anything wrong in the code.
My code in vb.
Try
Dim filePath As String = Request.QueryString("fn")
Response.ContentType = ContentType
Response.AppendHeader("content-disposition", "attachment; filename=" + Path.GetFileName(filePath))
Response.TransmitFile(filePath)
Response.Flush()
System.Threading.Thread.Sleep(1000)
If File.Exists(filePath) Then
File.Delete(filePath)
End If
If File.Exists(filePath) Then
File.Delete(filePath)
End If
Response.End()
Catch ex As Exception
oUtility.WriteLog("Exception Message : " + ex.Message, True)
vm.stat = 2
vm.message = "Internal server error"
Throw
End Try
Catch ex As Exception
oUtility.WriteLog("Exception Message : " + ex.Message, True)
vm.stat = 2
vm.message = "Internal server error"
Throw
End Try
My code in C#
string filePath = Request.QueryString["fn"];
Response.ContentType = ContentType;
Response.AppendHeader("content-disposition", "attachment; filename=" + Path.GetFileName(filePath));
Response.TransmitFile(filePath);
Response.Flush();
Response.ContentType = ContentType;
Response.AppendHeader("content-disposition", "attachment; filename=" + Path.GetFileName(filePath));
Response.TransmitFile(filePath);
Response.Flush();
System.Threading.Thread.Sleep(1000);
if (File.Exists(filePath))
{
File.Delete(filePath);
}
//response.writefile(filepath)
Response.End();
if (File.Exists(filePath))
{
File.Delete(filePath);
}
//response.writefile(filepath)
Response.End();
Amit GuptaPosted Oct 12, 2017, 4:19 PM