Private Sub SaveFile(ByVal reportNumber As String, ByVal logicFullFileName As String, ByVal reportType As String)
Dim fullFileName As String = Server.MapPath(logicFullFileName)
Dim downFile As FileInfo = New FileInfo(fullFileName)
If Not File.Exists(fullFileName) Then
Response.Write("The file not exist.")
Exit Sub
End If
Response.Clear()
Response.AddHeader("Content-Disposition", "attachment; filename=" + HttpUtility.UrlEncode(reportNumber & "." & reportType))
Response.AddHeader("Content-Length", downFile.Length.ToString())
Response.ContentType = "application/octet-stream"
Response.TransmitFile(fullFileName)
Response.End()
End Sub
Dim fullFileName As String = Server.MapPath(logicFullFileName)
Dim downFile As FileInfo = New FileInfo(fullFileName)
If Not File.Exists(fullFileName) Then
Response.Write("The file not exist.")
Exit Sub
End If
Response.Clear()
Response.AddHeader("Content-Disposition", "attachment; filename=" + HttpUtility.UrlEncode(reportNumber & "." & reportType))
Response.AddHeader("Content-Length", downFile.Length.ToString())
Response.ContentType = "application/octet-stream"
Response.TransmitFile(fullFileName)
Response.End()
End Sub