App download stalls in IE(7) but not Firefox

antic

Perch
Has anyone a clue about this?
I wrote a web app which has been working perfectly for ages. It creates a CSV file of some data and sends it to the browser in response to a POSTed form.
Suddenly the download is "stalling" in IE, but completes perfectly fine in Firefox. This happens on my machine and my client's machine. If they use Firefox it's ok too.
The only thing that changed was I moved the site from one server to another. But if there's an issue there, why would it only affect IE but not Firefox?
The code is basically as follows:
Code:
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Open
objStream.Type = 2 ' adTypeText
...
objStream.WriteText [comma-separated data stuff]
...
Response.Clear
Response.AddHeader "Content-Disposition", "attachment; filename=dataexport.csv"
Response.AddHeader "Content-Length", objStream.Size
Response.ContentType = "text/csv"
Response.CharSet = "UTF-8"
'
objStream.Position = 0 ' go back to start of data stream.
Response.Write(objStream.ReadText) ' write entire stream out to browser.
'
objStream.Close
Set objStream = Nothing
Response.End
Any ideas why IE would suddenly object to that?
 
weird....

I have no explanation, one download issue was happening (on a linux server) but it happened on both as you'd expect.
 
I've fixed it, by removing the use of ADODB.Stream and writing everything directly to Response.Write. Perhaps there's a weird glitch using Response.Write(objStream.ReadText). Perhaps the way IE uses connections causes the script to end and the objStream object to be discarded by ASP before it's finished being sent. That's the only thing I can think of. Anyway, all ok just using Response.Write.
 
Back
Top