|
Product |
FileUp |
Version |
all versions |
Title |
Error: Function returned |: Occurs when Instantiating FileUp or Accessing the First Form Element in the Upload Request |
Problem |
ASP 0101
Error number : (0x80004005)
ASP error description : The function returned |.
This error is returned when ASP's Request.BinaryRead method encounters difficulty reading the upload stream. Many kinds of interferences can cause the reading of the upload stream to fail. This article will outline some of these possibilities. |
Solution |
- Cancelling the upload request.
The easiest way to reproduce this error is upload a file and cancel the upload request just as Request.BinaryRead is handling the upload request. This is difficult to time and is more reliably reproduced with larger upload requests. Because of this, we suggest considering that if this error message is appearing in your event logs for only a very small percentage of your uploads, that it could represent uploads that have been cancelled by the application end-users.
The probability of this increases depending on user experience, for example, frustration due to large upload requests or slow connection speeds. Using a progress indicator with your FileUp application can be very helpful in reminding the user that the upload is still continuing. This may prevent premature cancelling of the upload request.
- Using SSL on a Windows 2000 server prior to the installation of Service Pack 3.
Service Pack 3 corrected this problem with SSL. This issue is described in more detail in KB article 279.
- Other interuptions.
Other interuptions to this process have been difficult to track down. We have had customers who have seemingly identical development and production environments and can only reproduce the behavior on one machine and not the other. For these situations, we recommend the following:
- Adjust the IIS's UploadReadAhead parameter in the registry.
UploadReadAhead is an IIS parameter that contains the amount of data that the server will read before passing control to the application. Instructions for locating this parameter are available in the FileUp documentation at: http://support.softartisans.com/docs/FileUp/install_tailor_readahead.htm. If this parameter is not present, see the instructions for adding it. The default value for this is 48kb. Adjust this value up or down and see if it reduces the occurence of this error.
- Use FileUp's ISAPI Filter.
In FileUp version 4, the first upload interceptor technology was introduced, which was an ISAPI level filter. This filter intercepts the upload and caches it to disk before it is processed by either the ASP or the ASP.NET dlls. This technology was originally designed for use with ASP.NET, as ASP.NET will cache the upload to memory, which is an inefficient use or server resources, and can even cause server crashes with large uploads. However, the ISAPI filter can also be used in an ASP environment. ASP does not cache the entire upload to memory, so memory usage is not the issue in this case. When addressing the "function returned |" error, the intent is to intercept the upload, allow the ISAPI filter to cache the upload to disk and then only hand a very small pointer over to ASP's Request.BinaryRead method. This significantly reduces the risk of having the BinaryRead method 'choke' on the upload contents, as it has almost nothing to process.
Use of an ISAPI level filter requires careful consideration of your server environment:
The FileUp ISAPI filter cannot be used in with IIS 6 without running the entire webserver in IIS 5 Isolation Mode. This is because IIS 6 does not support "Read Raw Data" ISAPI level filters in it's native processing mode.
If you are running version 5 of FileUp and using the httpModule for your ASP.NET uploads, you cannot have both the ISAPI filter and the httpModule installed on the same machine, as they will conflict with each other. The HttpModule is an ASP.NET dependent interceptor technology, so it unfortunately, is not a possible solution in an ASP environment for ASP's "function returned |" error. Rewriting your upload script in ASP.NET and using the HttpModule would be an effective solution for this error, since this error only occurs in the ASP environment.
ISAPI filters function at such a low level, that they easily can interfere with each other. On a production server, there may be several other ISAPI level filters installed. We highly recommend testing your installation of the FileUp ISAPI filter against not only your upload applications, but all other web applications running on that server. If version 4 or higher is a paid upgrade for you, please feel free to download an evaluation version of FileUp to test the ISAPI filter's behavior before committing to an upgrade.
|
Created : 6/3/2004 1:58:08 PM (last modified : 6/3/2004 1:58:08 PM) |
|