Flush Method

 Object: SoftArtisans.FileUp
 Syntax: Flush
(No parameters)
 Description: This method flushes the entire input HTTP Post input stream.

Use this method if you explicitly want to empty the entire input stream without performing any saves at all.

The following scenario illustrates the usefulness of this method:

  • A user attempts to upload a file larger than 48 KB
  • On the server, IIS reads the first 48 KB and then invokes SA-FileUp
  • An error or exception occurs during the processing of the script (from IIS, SA-FileUp, or some other processing in your script).
  • The browser reports a "Network Error" because it is still trying to send more data than was read by the server. The browser never displays the error message from the server because it considers that the request was never completed.
Use the Flush method during error handling to ensure that the entire input stream is cleared.

If you invoke any Save method (Save, SaveAs, SaveAsBlob, SaveBinaryAs), then the entire input stream will be cleared anyway.

It is never harmful to invoke the Flush method.

 

Previous Page Next Page