Abort a download

M

muriwai

Hi,

I manually stream out a file in chunks from my web form using PageAsyncTask,
Page.Response.OutputStream.BeginWrite and Flush after each chunk. I do set
the Content-Length header. If an error occurs (for example, a timeout), I do
the following:
response.OutputStream.Close();
response.Flush();
response.Close();

The trouble is, IE says that the download has completed successfully in
spite of the downloded file being incomplete. How can I force IE to display
an error (eg, Connection Was Reset) and abort the download?

Thanks!
--
 
M

Michael Nemtsev

Hello muriwai,

See there the list of conversion libs http://csharp-source.net/open-source/pdf-libraries

---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

m> Hi,
m>
m> I manually stream out a file in chunks from my web form using
m> PageAsyncTask,
m> Page.Response.OutputStream.BeginWrite and Flush after each chunk. I
m> do set
m> the Content-Length header. If an error occurs (for example, a
m> timeout), I do
m> the following:
m> response.OutputStream.Close();
m> response.Flush();
m> response.Close();
m> The trouble is, IE says that the download has completed successfully
m> in spite of the downloded file being incomplete. How can I force IE
m> to display an error (eg, Connection Was Reset) and abort the
m> download?
m>
m> Thanks!
m>
 
S

Steven Cheng[MSFT]

Hi Michael,

Based on my test, when you turn off buffer of the page resposne, it will
write out response headers at initial flush so that after the server-side
close or terminate the connection, the client-side will just act like the
response output finished. I've tried through exception or abort response or
worker thread but haven't got any effect. I think this due to the ASP.NET's
control over response is at a high application level that doen't deep
enough for the raw HTTP communication. For your scenario, you may consider
some IIS isapi filter solution as it can help much more control over the
underlying http communication.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================



This posting is provided "AS IS" with no warranties, and confers no rights.
 
S

Steven Cheng[MSFT]

Hi Michael,

Yes, most url length or some non-http specific features will be defined by
client browser. So for this problem, you've also tested it on other
browsers? Also, you can post in some IE general discussion newsgroup for
some further idea on this.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 

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

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,150
Latest member
MakersCBDReviews
Top