Last post Aug 04, 2011 02:23 PM by atconway
Aug 02, 2011 03:53 PM|NateWon|LINK
Not sure where to put this question isn't VB specific but doesn't look to fit the other forums?
I have a system which needs to be secure which streams relatively large documents from a webservice to a proxy (Web site) whch then grabs the stream and pushes this to the client. This works but there are some issues where it seems the response is not being
pushed until the entire stream is complete? whether this is the case Im not sure have run charles and until it completes it is "Waiting for response".
The documents are currently PDF but it needs to handle many other types for the future. The octet stream etc is mostly testing related,
Any ideas on how to get the Dialog to show - saying save as? for the large files the little ones don't matter to much but the big ones leave a big waiting period with no response.
Dim IncomingResponse As HttpWebResponse = DirectCast(Request.GetResponse(), HttpWebResponse)
Dim IncomingStream = IncomingResponse.GetResponseStream()
Dim BufferSize As Integer = 65536
Dim Buffer(BufferSize) As Byte
Dim Count = IncomingStream.Read(Buffer, 0, BufferSize)
While (Count > 0)
Context.Response.OutputStream.Write(Buffer, 0, Count)
Count = IncomingStream.Read(Buffer, 0, BufferSize)
Dim ApplicationType As String = R.DocumentFileType.ToLower
If Not ApplicationType.Contains("application/") Then
ApplicationType = "application/" & ApplicationType
Dim AttachmentStr = ""
If (R.DocumentSize / 1000) > 1000 Then '1MB ish
AttachmentStr = "attachment; "
ApplicationType = "application/octet-stream"
Response.AddHeader("Content-Disposition", AttachmentStr & "filename=" & FileName.Replace(" ", "_"))
Aug 04, 2011 02:23 PM|atconway|LINK
See if maybe this helps any: