Syntax
| JavaScript | Copy Code
|
|---|---|
<script type="text/javascript" src="iuembed.js"></script> <script type="text/javascript"> function ImageUploaderID_PackageProgress(PackageIndex, Status, Progress, ValueMax, Value, StatusText) { //...your code... } var iu = new ImageUploaderWriter("ImageUploaderID", 610, 500); //...params... //...other event listeners... iu.addEventListener("PackageProgress", "ImageUploaderID_PackageProgress"); //...other event listeners... iu.writeHtml(); </script> |
|
Parameters
- PackageIndex
-
Zero-based index of the package (i.e. request) inside the current upload session.
- Status
-
A string value that contains the textual information indicating the current step of the package upload. It can take one of the following values:
Value Description STARTThe current package upload process has been started. This value is passed to only for the very first event raising. PREPAREData is being prepared for the current package upload (thumbnails are generated, request is being constructed, etc). The upload is not started yet. UPLOADData is being uploaded to the server. WAITINGUpload has been broken and Image Uploader waits to make attempt to resume the upload. COMPLETEThe current package 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 the current package. CANCELThe 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 current package. ERRORSome error occurred during the upload. This value is passed only once and this is always the very last value for all files uploaded in the current package. - 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, orWAITINGPercentage of the whole current package upload process completion. START,COMPLETE,CANCEL, orERRORNo 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 PREPARENumber of files to be prepared in the current request (package). UPLOADTotal size of data of the current request (in bytes). WAITINGTotal number of milliseconds Image Uploader is waiting between upload resume attempts. START,COMPLETE,CANCEL, orERRORNo 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 PREPARENumber of files in the current request (package) that have already been prepared. UPLOADAmount of bytes of the current request (package) that have already been sent to the server. WAITINGNumber of milliseconds Image Uploader has been waited since the last upload resume attempt. ERROROne of the error codes:
- 1 - number of selected files is less than number of files allowed for the upload;
- 2 - server, specified in the Action URL was not found (it is down or the server name is misspelled);
- 3 - URL specified in the Action property has an incorrect syntax;
- 4 - some server-side error occurred. The StatusText argument contains the server response which can be used for diagnostics;
- 8 - total size of selected files exceeds the MaxTotalFileSize value;
- 11 - server returned HTTP code 3xx (e.g. 302 or 304) during redirection. The StatusText contains the URL server redirects to;
- 12 - the upload was aborted from the script (using the Stop method);
- 0 - unspecified error.
START,COMPLETE, orCANCELNo 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 PREPAREName of the file which is currently being prepared. UPLOADName of the file which is currently being uploaded to the server. WAITINGThe ProgressDialogWaitingForRetryText property value. COMPLETEorERRORResponse from the server which is returned by the page files are uploaded to. STARTorCANCELNo meaningful value.
Remarks
This event allows you to handle errors which can occur during the current package upload, display progress indicator directly in HTML code, detect when the upload is finished, etc.
Copy Code