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()
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()