Home     Products      Support      Corporate     Sign In 
Support Knowledge Base, Article 624
Product
FileUp
Version
4
Title
Downloaded files are corrupted
Problem
When using FileUp to download files, the downloaded files will become corrupted if there is any HTML code into the response stream
Solution
HTML code cannot be included in the HTTP Response with a downloaded file without corrupting the file, because the browser cannot parse the body of the Response and distinguish the HTML code from the content of the file. An HTTP download must contain only the response headers and the binary file itself.

To prevent the Response stream from being corrupted by extraneous HTML, you can clear it before calling the TransferFile method, and then end the Response:


Response.clear
upl.TransferFile "c:\folder\sample.doc"
Response.end

Possible causes of extraneous HTML code in the Response are:

  1. HTML response generated by the download processing page in an attempt to send a message to the user. Instead of inserting HTML code into the download page, the client form could be redirected to another page.
  2. A file download may also be corrupted by server-side debugging messages. To turn off server-side debugging, open the IIS console and right-click on the default website and select Properties. Select the Home Directory tab and then press the Configuration button; select the App Debugging tab and un-check both Debugging Flags.
  3. If you are using an evaluation copy of FileUp, the downloaded files might be corrupted by the warning message that is automatically presented to users after they upload or download a file. This warning message appears for the last 10 days before the evaluation version expires. NOTE: The warning message cannot be removed using the method described above with Response.clear, because the warning message is generated by FileUp itself when TransferFile is called. If you need to test or demonstrate FileUp's download functionality during the end of a month, please contact SoftArtisans support to obtain a newer evaluation version.
Created : 9/30/2003 5:24:42 PM (last modified : 3/26/2008 5:03:50 PM)
Rate this article!
Comments