Hello there, can anyone help me with my proble. The code below run perfectly. The only thing is that after the Sub DownloadFile (FilePath as String) is run the whole webpage seem to stop. The message "Download Completed!" never show at all. When I try to click
on other links, it doesn't work as well. It only work when I click the refresh button. Any ideas why? Sub Download (s As Object, e As ImageClickEventArgs) DownloadFile (MapPath(FileUrl)) lblDownload.Text = "Download completed!" End Sub Sub DownloadFile(FilePath
as String) If File.Exists(FilePath) Then Dim myFileInfo as FileInfo myFileInfo = New FileInfo(FilePath) Response.Clear() Response.ContentType = "application/octet-stream" Response.AppendHeader("Content-Disposition", "attachment; filename=""" & _ myFileInfo.Name
& """") Response.WriteFile(FilePath) Response.End() End If End Sub Thaning you in advance for your help. Chan
chanloongloo
Member
5 Points
1 Post
Force download box
Dec 16, 2002 11:45 AM|LINK