M
maglev_now
After the user downloads a file from filedownload.aspx I am unable to get
them back to the default page for my site. Any suggestions?
code from filedownload.aspx
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim filename As String = DirectCast(Session("FileName"), String)
Dim filepath As String = DirectCast(Session("FilePath"), String)
Dim fullpath As String = filepath + "\" + filename
Response.Clear()
Response.ContentType = "application/octet-stream"
Response.AddHeader("Content-Disposition", _
"attachment; filename=""" & filename & """")
Response.Flush()
Response.WriteFile(fullpath)
End Sub
This forces the download file dialog in explorer. I get an error when
adding a redirect after Response.WriteFile(fullpath). It says you cannot
redirect after headers have been written. Dunno, please help.
them back to the default page for my site. Any suggestions?
code from filedownload.aspx
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim filename As String = DirectCast(Session("FileName"), String)
Dim filepath As String = DirectCast(Session("FilePath"), String)
Dim fullpath As String = filepath + "\" + filename
Response.Clear()
Response.ContentType = "application/octet-stream"
Response.AddHeader("Content-Disposition", _
"attachment; filename=""" & filename & """")
Response.Flush()
Response.WriteFile(fullpath)
End Sub
This forces the download file dialog in explorer. I get an error when
adding a redirect after Response.WriteFile(fullpath). It says you cannot
redirect after headers have been written. Dunno, please help.