Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: Canceled File Download hangs user


Message #1 by "John Choi" <jchoi@c...> on Tue, 18 Sep 2001 01:13:16
I'm streaming data to the user in the form of a CSV file. It's not a 

physical file stored on our servers. I dynamically build a CSV file based 

on the user's request.

Because the amount of data the user receives will typically be large, I 

stream the data back to the user in bits with code similar to the 

following:



   Response.Buffer = True

   Response.ContentType = "text/csv"

   Response.AddHeader "Content-Disposition","inline; filename=data.csv"



   while not Finished

      Response.Write ...

      Response.Flush

   wend



It's great because the user gets the "File Download" dialog immediately.



However, the problem is that when the user selects "cancel", the server 

doesn't know the user selected "cancel" and will continue building the CSV 

file. But to the user, it looks like the server crashed.



Does anyone know if there's a way to check if the user selected "cancel" 

and break out of that While loop if the user wants to cancel?



John

jchoi@c...


  Return to Index