This documentation is for the old version. Go to the latest Upload Suite docs

ImageUploader.Progress Event

Supported in: ActiveX , Java

Raised to indicate the progress of the upload.

Syntax

JavaScript
<script type="text/javascript" src="iuembed.js">  </script>
<script type="text/javascript">
function ImageUploaderID_Progress(Status, Progress, ValueMax, Value, StatusText) {
	//...your code...
}
var iu = new ImageUploaderWriter("ImageUploaderID", 610, 500);
//...params...
//...other event listeners...
iu.addEventListener("Progress", "ImageUploaderID_Progress");
//...other event listeners...
iu.writeHtml();
</script>

Parameters

Status

A string value that contains the textual information indicating the current step of the upload. It can take one of the following values:

Value Description
START The upload process has been started. This value is passed to only for the very first event raising.
PREPARE Data is being prepared for the upload (thumbnails are generated, request is being constructed, etc). The upload is not started yet.
UPLOAD Data is being uploaded to the server.
WAITING Upload has been broken and Image Uploader waits to make attempt to resume the upload.
COMPLETE The upload process has been successfully completed. This value is passed only once and this is always the very last value for all files uploaded in a single upload session (regardless to the number of packages per one session and number of concurrent connections).
CANCEL The upload process is cancelled by the user. This value is passed only once and this is always the very last value for all files uploaded in a single upload session (regardless to the number of packages per one session and number of concurrent connections).
ERROR Some error occurred during the upload. This value is passed only once and this is always the very last value for all files uploaded in a single upload session (regardless to the number of packages per one session and number of concurrent connections). If multiple concurrent connections are used and several of them failed, this value is passed only for the last one.
Progress

An integer value that contains the degree of completion of the upload or preparation process (in per cents). According to the value of the Status argument the Progress has different meanings:

Value Meaning
PREPARE, UPLOAD, or WAITING Percentage of the whole upload process completion (taking into account all packages and concurrent connections in the current upload session).
START, COMPLETE, CANCEL, or ERROR No meaningful value.
ValueMax

An integer value that contains the maximum value of the Value argument for the current upload step. Keep in mind, this value may vary for different event handler calls. According to the value of the Status parameter, the ValueMax has different meanings:

Value Meaning
PREPARE Number of files to be prepared in the current request (package) for the current connection.
UPLOAD Total size of data of the current request (in bytes).
WAITING Total number of milliseconds Image Uploader is waiting between upload resume attempts.
START, COMPLETE, CANCEL, or ERROR No meaningful value.
Value

An integer value that contains the current value of the progress. Also, if some error occurs, this argument contains the error code. According to the value of the Status argument, the Value has different meanings:

Value Meaning
PREPARE Number of files in the current request (package) that have already been prepared.
UPLOAD Amount of bytes of the current request (package) that have already been sent to the server.
WAITING Number of milliseconds Image Uploader has been waited since the last upload resume attempt.
ERROR

One of the error codes:

  • 1 - number of selected files is less than number of files allowed for the upload;
  • 2 - URL specified in the Action property was not found;
  • 3 - URL specified in the Action property has an incorrect syntax;
  • 4 - some server-side error occurred;
  • 6 - size of the selected file exceeds the MaxFileSize value;
  • 7 - number of selected files exceeds the MaxFileCount value;
  • 8 - total size of selected files exceeds the MaxTotalFileSize value;
  • 9 - upload was aborted from the Progress Dialog;
  • 10 - Java applet throws an out of memory exception;
  • 11 - server returned HTTP code 3xx (e.g. 302 or 304) during redirection;
  • 12 - upload was aborted from the script (using the Stop() method);
  • 13 - trial period has expired.
  • 18 - upload was aborted from the PackageComplete event handler (the handler returns false);
  • 19 - image dimensions are too large. Image width or height exceeds the MaxImageWidth or MaxImageHeight value;
  • 20 - image dimensions are too small. Image width or height is less than the MinImageWidth or MinImageHeight value;
  • 21 - size of the selected file is less than the MinFileSize value;
  • 0 - unknown error.
START, COMPLETE, or CANCEL No meaningful value.
StatusText

A string value that contains the textual information for the current step. According to the value of the Status argument, the StatusText has different meanings:

Value Meaning
PREPARE Name of the file which is currently being prepared.
UPLOAD Name of the file which is currently being uploaded to the server.
WAITING The ProgressDialogWaitingForRetryText property value.
COMPLETE or ERROR Response from the server which is returned by the page files are uploaded to.
START or CANCEL No meaningful value.

Remarks

This event allows you to handle errors which can occur during the upload, display progress indicator directly in HTML code, detect when the upload is finished, etc.

Keep in mind that this is a through event for whole upload process. Even if you send files in several concurrent upload threads, the total progress is calculated (rather than for individual connection). If you need to know which connection the current event handler call corresponds to, use the CurrentConnectionId property.

See Also

Manual

Reference