Posted on: 8/6/2015 10:18:03 PM | Views : 742

Hi All,
I have the following code in my web page:
Protected Function SendData(ByVal filepath As String) As Boolean Dim ReturnResults As Boolean = False Dim iStream As System.IO.Stream = Nothing Dim buffer As Byte() = New [Byte](9999) {} Dim length As Integer Dim dataToRead As Long Dim filename As String = System.IO.Path.GetFileName(filepath) Try iStream = New System.IO.FileStream(filepath, System.IO.FileMode.Open, System.IO.FileAccess.Read, System.IO.FileShare.Read) dataToRead = iStream.Length Response.Clear() Response.ContentType = "application/octet-stream" Response.AddHeader("Content-Disposition", "attachment; filename=" & filename) While dataToRead > 0 If Response.IsClientConnected Then ...

Go to the complete details ...