Error when uploading large files in classic ASP

Error when uploading large files in classic ASP

am 04.10.2007 01:08:47 von miTcheLL

I have a client who has a product written in classic ASP that is
deployed at ~100 client sites around the country. The web application
needs to accept large uploads from its users, and so to account for this
they include step-by-step instructions to the administrators installing
the application to manually edit the IIS metabase and update the
AspMaxRequestEntityAllowed entry from 2MB to a suitable value (usually
100 MB). On the classic ASP side, they use a third-party component
called aspSmartUpload (a product line that has since been discontinued).

Uploading large files has worked fine for all of their clients so far,
but they have a new one that is reporting problems. On the development
server, the code works fine, but when they move the application to the
production or QA servers, attempting to upload a large file returns the
following error:

Event Type: Error
Event Source: Active Server Pages
Event Category: None
Event ID: 5
Date: 8/31/2007
Time: 8:00:20 AM
User: N/A
Computer: CEONLINE
Description:
Error: File /PSP/app/code/ord/ord_AttachFunctions.asp Line 479
Unexpected error. The function returned |..


From http://support.softartisans.com/kbview_851.aspx: "This error is
returned when ASP's Request.BinaryRead method encounters difficulty
reading the upload stream."

The above article suggests trying to increase the UploadReadAhead
setting in the Registry, which the client is going to try, but I was
wondering if anyone else had experienced this error previously or has
any suggestions or recommendations for a solution.

Thanks

--

Scott Mitchell [ASP.NET MVP]
mitchell@4GuysFromRolla.com
http://www.4GuysFromRolla.com/ScottMitchell

Re: Error when uploading large files in classic ASP

am 04.10.2007 14:15:57 von tiago.halm

Scott,

BinaryRead increases the ammount of data IIS will read before passing
it down to the ISAPI Extension (ASP in this case) upon request. You
may need to increase the memory of the box.

Have you checked if the problem is with trying to access the form
elements before the upload as whole has finished? You cannot access
Request.Form and then try again to perform Request.BinaryRead. The KB
title does specify that probable cause in the title ("Error: Function
returned |: Occurs when Instantiating FileUp or Accessing the First
Form Element in the Upload Request"), so I'm not sure what is causing
the error, there are too many variables here involved. I see a
description of too many probable causes for this issue in their KB.

What error is returned by ASP.BinaryRead (not by the SoftArtisans
software)?
Are there more event errors related to this?

I'm sure Microsoft can even help here to diferentiate between the
UploadReadAheadSize metabase entry [1] and and the UploadReadAhead
registry entry [2]. [1] probably applies per metabase path you
specify, while [2] applies to IIS as a whole ...

[1] http://www.microsoft.com/technet/prodtechnol/WindowsServer20 03/Library/IIS/48900606-4881-4a93-a4c1-0e0ac622fee6.mspx?mfr =true
[2] http://www.microsoft.com/technet/prodtechnol/WindowsServer20 03/Library/IIS/d779ee4e-5cd1-4159-b098-66c10c5a3314.mspx?mfr =true

Tiago Halm
http://www.codeplex.com/filterdotnet