Multiple Requests (windows)

P

PJ

My web application will open a popup that, upon a user action, will initiate
a request that will result in a file being sent as an attachment to the
client. The download works fine, except that the user is no longer able to
browse and get responses in the main window. The request just seems to hang
and does not get the response until the download is finished. It only seems
to effect the session in which the download is taking place. Other clients,
even on the same computer, are not experiencing request/response issues. I
doubt it's an issue with the server side code I am using for the download,
but here it is nonetheless. Any advice on this issue would be greatly
appreciated. TIA~ PJ

Dim br As New BinaryReader(fs)
Dim offset As Long
Response.Clear()
Response.BufferOutput = False
Response.Buffer = False
Response.ContentType = "application/octet-stream"
Response.AddHeader("Content-Disposition", "attachment; filename=" +
fileName)
Response.AddHeader("Content-Length", fs.Length.ToString())
Response.Flush()

Dim totalSize As Long = fs.Length
Dim size As Long
Do
If offset + CHUNK_SIZE > totalSize Then
size = totalSize - offset
Else
size = CHUNK_SIZE
End If
If Not Response.IsClientConnected Then
Exit Do
End If
Response.BinaryWrite(br.ReadBytes(Convert.ToInt32(size)))
fs.Flush()
Response.Flush()
offset += size
Loop Until offset >= totalSize
fs.Close()
br.Close()
Response.Close()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,062
Latest member
OrderKetozenseACV

Latest Threads

Top