Home     Products      Support      Corporate     Sign In 
Support Knowledge Base, Article 1332
SendRequest method fails in ASP.NET on Windows 7 and Windows Server 2008 R2
FileUpEE's SendRequest method is used in 3-tier uploads and optionally in 3-tier downloads. Currently, in the scenario described below, there is an issue with this method, it throws the "SendRequest failed" error:
  • The OS is Windows 7 or Windows Server 2008 R2 (previous releases of Windows Server 2008 do not have this problem)
  • FileUpEE is being used in an ASP.NET application
  • FileUpEE's TransferEncoding property is not set to chunked in the webserver code
The problem occurs after the webserver-to-fileserver request has been sent successfully, when the SendRequest method attempts to process the response from the fileserver. During a 3-tier upload, the result is that the files are successfully saved on the fileserver, but an exception is thrown on the webserver. In 3-tier downloads that use SendRequest, the download fails completely because the downloaded file is contained in the fileserver's response.
This issue will be addressed in a future version of FileUpEE. In the meantime, there are effective workarounds for the problem.
  1. For both uploads and downloads, turning on chunked transfer encoding on the webserver will resolve the problem.
  2. For downloads, another option is to switch to the TransferFile method which is used for streaming 3-tier downloads (no temporary files are cached on the webserver).

Turning on chunked encoding on the webserver

Chunked encoding on the webserver is required for 3-tier uploads over 2 GB. However, even if you do not need to upload files over 2 GB, turning on chunked encoding will not have any negative impact on the application (aside from one minor known issue [*]). The only difference between chunked encoded and regular requests is that the request does not include a content-length header. Instead, it will have the “Transfer-Encoding: chunked” header and is sent as a series of chunks, each preceded by its own size indicator.

Chunked encoding is turned on by setting FileUpEE's TransferEncoding property to saChunked before calling SendRequest.

[C# example]

oFileUpEE.set_TransferEncoding(saTransferStage.saWebServer, saTransferEncoding.saChunked);

[VB.NET example]

oFileUpEE.TransferEncoding(saTransferStage.saWebServer) = saTransferEncoding.saChunked

Using TransferFile for 3-tier downloads

The SendRequest method is used in 3-tier downloads that cache files on the webserver. An alternate and recommended approach for 3-tier downloads is the TransferFile method which streams the files through the webserver without caching anything to disk. You can see the documentation for the TransferFile method at the following link: http://docs.softartisans.com/FileUpEE/5.3.0//Default.aspx?redirect=reference/prog_ref_objFileUpEE.htm (this is the main reference page for the FileUpEe object. Scroll down and click on “TransferFile” under the list of FileUpEe’s methods). There are extensive samples in FileUpEE version 5.2 (and above) that use the TransferFile method (if you have the product installed, see the 3-tier samples under Program Files\SoftArtisans\FileUpEE\Samples\XFileEEDotNetSamples\)

[*] Currently there is one minor issue with turning on chunked encoding in the webserver page. For 3-tier uploads that are using FileUpEE’s server-side progress indicator (the FileUpEeProgress object), after turning on chunked encoding on the webserver, the webserver-to-fileserver part of the 3-tier progress will not display. The client-to-webserver progress will still work properly. This issue will be addressed in a future version of FileUpEE.

The display of the webserver-to-fileserver part of the progress is not a common practice. Most of our clients do not want users to see that the files are being uploaded from the webserver to the isolated fileserver. However, if you wish to show progress, as a workaround to this known issue, you can display a generic message or an image to the user indicating that the files are being transferred from the webserver to the fileserver.
Created : 2/11/2010 11:59:18 AM (last modified : 2/11/2010 11:59:17 AM)
Rate this article!