Response.TransmitFile and Action Canceled page

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm developing an interface that sends a file to the client. it works but
the client also gets an "Action canceled" page (IE) how can I remove this
page? or display the application home page?

thank you!

the conde is in the Page_Load sub:

Response.Clear()
Response.AddHeader("Content-Length",
DownloadFile.Length.ToString())
Response.ContentType = "application/octet-stream"
Response.AppendHeader("Content-Disposition", "attachment;
filename=" & FileName)
Response.TransmitFile(DownloadFile.FullName)

Response.Flush()
Response.Close()
 
either the user hit stop, which you can do nothing about, or you page timed
out becuase the download took too long. up the scripttimeout for the page.

note: asp.net will max out at about 50 concurrent downloads, so you do not
want then to take too long.

-- bruce (sqlwork.com)
 
Bruce,

All users were getting the same behavior even with small files…

Now, I commented out this code:
‘ Response.Flush()
‘ Response.Close()
Then, build and publish the site
Then, tested and: Sometimes the page was getting closed and sometimes not.
Also, every other time, the file was displayed between the html of the home
page!

Then, I removed the comments
Response.Flush()
Response.Close()

Then, build and publish the site again

Now everything works fine! The page gets closed automatically

Is there a bug in IIS or .NET 2005?

Thanks for your help
 

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

Back
Top