PC Review


Reply
Thread Tools Rate Thread

Abort a download

 
 
muriwai
Guest
Posts: n/a
 
      26th May 2007
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!
--



 
Reply With Quote
 
 
 
 
Michael Nemtsev
Guest
Posts: n/a
 
      26th May 2007
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>


 
Reply With Quote
 
Michael Nemtsev
Guest
Posts: n/a
 
      26th May 2007
Hello Michael ,

Emm, sorry, missed the tread

---
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

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


 
Reply With Quote
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      28th May 2007
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/subscripti...ult.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/subscripti...t/default.aspx.

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



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

 
Reply With Quote
 
muriwai
Guest
Posts: n/a
 
      28th May 2007
Hi Steven,

This looks like a bug in Internet Explorer when it offers an incomplete
download to a user, even though Content-Length does not match the actual
file length. According to
http://www.w3.org/Protocols/rfc2616/...c4.html#sec4.4, Content-Length
takes precedence over the server closing the connection. I'd pass this along
to the IE team.

Thanks


--

"Steven Cheng[MSFT]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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/subscripti...ult.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/subscripti...t/default.aspx.
>
> ==================================================
>
>
>
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>



 
Reply With Quote
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      30th May 2007
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.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Data Abort & Prefetch Abort Simone Microsoft Dot NET Compact Framework 0 8th Nov 2007 02:37 PM
IE Abort =?Utf-8?B?S01Q?= Windows XP Internet Explorer 0 7th Oct 2005 04:33 PM
Web Abort =?Utf-8?B?S01Q?= Windows XP General 2 6th Oct 2005 04:06 PM
how to force Thread.Abort() to Abort ? Andy Fish Microsoft C# .NET 13 22nd Jan 2005 05:09 PM
How can I abort... Steven K Windows XP General 7 14th Jul 2004 05:57 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:20 PM.