thanks for efforts, i've managed to find a way:
Dim filename As String = "C:\SomeFile.txt"
Dim FS As FileStream = New FileStream(filename, FileMode.Open)
Dim iFullSize As Integer = FS.Length
Response.Clear()
Response.AddHeader("Content-Type", "binary/octet-stream")
Response.AddHeader("Content-Disposition", _
"attachment; filename=DownloadedImage.txt; size=" _
+ iFullSize.ToString())
Response.AddHeader("Content-Length", iFullSize.ToString())
Response.Flush()
Dim chunkSize As Integer = 1024
Dim i As Integer
For i = 0 To iFullSize Step chunkSize
' Everytime check to see if the browser is still connected
If (Not Response.IsClientConnected) Then
Exit For
End If
Dim size As Integer = chunkSize
If (i + chunkSize >= iFullSize) Then
size = (iFullSize - i)
End If
Dim chunk(size - 1) As Byte
FS.Read(chunk, 0, size)
Response.BinaryWrite(chunk)
Response.Flush()
Next
FS.Close()