Re: Upload a File to a Web Server and error handling

From: Mike Moore [MSFT] (michmo_at_online.microsoft.com)
Date: 02/06/04


Date: Fri, 06 Feb 2004 00:00:00 GMT

Hi Al,

I found some more information for you. Sorry it took so long.

Most of the processing done by ASP.NET does not begin until after the
server has received the whole post from the client. When ASP.NET detects up
front that the post is too large, then it immediately sends an error,
without proceeding any further. While this has some benefits, it also means
that you cannot trap this error to handle it in a custom manner.

One benefit is that your server does not have to receive and store in
memory the entire posted data before rejecting it. This saves server
resources.

Another benefit is that the client may receive this error before it
finishes sending everything it wants to send. If it receives this
particular error (rather than a custom page of your choice), the client can
recognize this error as a signal to stop sending even though it's not
finished.

I'm sorry this isn't the answer you were hoping for, but I hope the
information is helpful.

Thank you, Mike
Microsoft, ASP.NET Support Professional

Microsoft highly recommends to all of our customers that they visit the
http://www.microsoft.com/protect site and perform the three straightforward
steps listed to improve your computer’s security.

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

--------------------
> From: "Al Smith" <asmith@NOSPAMmrisystem.com>
> References: <uSEvkB63DHA.1052@TK2MSFTNGP12.phx.gbl>
<Tj2erJ$3DHA.1512@cpmsftngxa07.phx.gbl>
<ekBjTlC4DHA.876@TK2MSFTNGP10.phx.gbl>
<DHOJd5T4DHA.1988@cpmsftngxa07.phx.gbl>
<HAOP0oG5DHA.568@cpmsftngxa07.phx.gbl>
> Subject: Re: Upload a File to a Web Server and error handling
> Date: Tue, 27 Jan 2004 16:39:15 -0500
> Lines: 142
> X-Priority: 3
> X-MSMail-Priority: Normal
> X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
> Message-ID: <#IwME4R5DHA.2760@TK2MSFTNGP09.phx.gbl>
> Newsgroups: microsoft.public.dotnet.framework.aspnet
> NNTP-Posting-Host: 12.17.95.135
> Path:
cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.
phx.gbl
> Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.framework.aspnet:205510
> X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
>
> Hi Mike,
>
> I had no idea that this was a hard one. I just thought I could not find
the
> proper documentation.
>
> Thanks
>
> Al
>
> ""Mike Moore [MSFT]"" <michmo@online.microsoft.com> wrote in message
> news:HAOP0oG5DHA.568@cpmsftngxa07.phx.gbl...
> > Hi Al,
> >
> > This is just a quick note to let you know that we're still researching.
> > I'll post more as soon as I can.
> >
> > Thank you, Mike
> > Microsoft, ASP.NET Support Professional
> >
> > Microsoft highly recommends to all of our customers that they visit the
> > http://www.microsoft.com/protect site and perform the three
> straightforward
> > steps listed to improve your computer's security.
> >
> > This posting is provided "AS IS", with no warranties, and confers no
> rights.
> >
> >
> > --------------------
> > > X-Tomcat-ID: 279843854
> > > References: <uSEvkB63DHA.1052@TK2MSFTNGP12.phx.gbl>
> > <Tj2erJ$3DHA.1512@cpmsftngxa07.phx.gbl>
> > <ekBjTlC4DHA.876@TK2MSFTNGP10.phx.gbl>
> > > MIME-Version: 1.0
> > > Content-Type: text/plain
> > > Content-Transfer-Encoding: 7bit
> > > From: michmo@online.microsoft.com ("Mike Moore [MSFT]")
> > > Organization: Microsoft
> > > Date: Thu, 22 Jan 2004 23:20:42 GMT
> > > Subject: Re: Upload a File to a Web Server and error handling
> > > X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
> > > Message-ID: <DHOJd5T4DHA.1988@cpmsftngxa07.phx.gbl>
> > > Newsgroups: microsoft.public.dotnet.framework.aspnet
> > > Lines: 71
> > > Path: cpmsftngxa07.phx.gbl
> > > Xref: cpmsftngxa07.phx.gbl
> microsoft.public.dotnet.framework.aspnet:204376
> > > NNTP-Posting-Host: tomcatimport2.phx.gbl 10.201.218.182
> > >
> > > Hi Al,
> > >
> > > We're still looking into your issue. The maximum request length is
> tested
> > > very early in the processing of an incoming request, well before your
> > page
> > > gets involved. When too large, the request is aborted at this early
> stage
> > > and the code in your page is not executed. The Try/Catch block around
> > your
> > > call to SaveAs can catch other errors, such as access denied.
> > >
> > > We're looking into using an httpModule to handle this error. I'll let
> you
> > > know as soon as I have more information.
> > >
> > > Another possibility is to set maxRequestLength to a high value. Then
> test
> > > File1.PostedFile.ContentLength before calling File1.PostedFile.SaveAs.
> > > However, this has some drawbacks. One issue is that the large request
> > will
> > > be taking up server memory for a longer time before being discarded.
> > Please
> > > see the "More Information" section in this article for more
information
> > > about consequences of setting maxRequestLength to a large value.
> > > 323245 HOW TO: Upload a File to a Web Server in ASP.NET by Using
Visual
> > > Basic
> > > http://support.microsoft.com/?id=323245
> > >
> > > Thank you, Mike
> > > Microsoft, ASP.NET Support Professional
> > >
> > > Microsoft highly recommends to all of our customers that they visit
the
> > > http://www.microsoft.com/protect site and perform the three
> > straightforward
> > > steps listed to improve your computer's security.
> > >
> > > This posting is provided "AS IS", with no warranties, and confers no
> > rights.
> > >
> > >
> > > --------------------
> > > > From: "Al Smith" <asmith@NOSPAMmrisystem.com>
> > > > References: <uSEvkB63DHA.1052@TK2MSFTNGP12.phx.gbl>
> > > <Tj2erJ$3DHA.1512@cpmsftngxa07.phx.gbl>
> > > > Subject: Re: Upload a File to a Web Server and error handling
> > > > Date: Wed, 21 Jan 2004 09:17:37 -0500
> > > > Lines: 22
> > > > X-Priority: 3
> > > > X-MSMail-Priority: Normal
> > > > X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
> > > > X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
> > > > Message-ID: <ekBjTlC4DHA.876@TK2MSFTNGP10.phx.gbl>
> > > > Newsgroups: microsoft.public.dotnet.framework.aspnet
> > > > NNTP-Posting-Host: 12.17.95.135
> > > > Path:
> > >
> >
>
cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.
> > > phx.gbl
> > > > Xref: cpmsftngxa07.phx.gbl
> > microsoft.public.dotnet.framework.aspnet:203878
> > > > X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
> > > >
> > > > I'll check back Steven, thanks.
> > > >
> > > > Al
> > > >
> > > > "Steven Cheng[MSFT]" <v-schang@online.microsoft.com> wrote in
message
> > > > news:Tj2erJ$3DHA.1512@cpmsftngxa07.phx.gbl...
> > > > > Hi AI,
> > > > >
> > > > > Thank you for posting in community. Regarding on the issue, I am
> > > > > finding proper resource to assist you and we will update as soon
as
> > > > posible.
> > > > >
> > > > > Regards,
> > > > >
> > > > > Steven Cheng
> > > > > Microsoft Online Support
> > > > >
> > > > > Get Secure! www.microsoft.com/security(This posting is provided
"AS
> > IS",
> > > > > with no warranties, and confers no rights.)
> > > > >
> > > >
> > > >
> > > >
> > >
> > >
> >
>
>
>



Relevant Pages

  • Re: Upload a File to a Web Server and error handling
    ... > server has received the whole post from the client. ... > that you cannot trap this error to handle it in a custom manner. ... > Microsoft highly recommends to all of our customers that they visit the ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: RunTime Error - After my web site running 2 or 3 days
    ... Make sure the server 'EXPORTNETWORK.exortcanada.local' is ... The application-specific permission settings do not grant Local Activation ... custom error settings for this application prevent the details of the ... This tag should then have its ...
    (microsoft.public.dotnet.languages.csharp)
  • Cannot Access Sharepoint Central Administrator
    ... An application error occurred on the server. ... "web.config" configuration file located in the root directory of the current ... The current error page you are seeing can be replaced by a custom ... Thread account name: NT AUTHORITY\NETWORK SERVICE Is impersonating: ...
    (microsoft.public.sharepoint.windowsservices)
  • Re: Windows Service config file
    ... You can also use configuration file to set the custom error mode. ... //here SimpleRemotingSln.ServerApp.exe is my server appliation's exe file ... But this doesn't answer the question whether you are using a Config file ... your remoting service. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Companyweb unable to access
    ... An application error occurred on the server. ... "web.config" configuration file located in the root directory of the ... install right out of the box on a virgin HDD, ...
    (microsoft.public.windows.server.sbs)