Suppose that users open a page where Image Uploader is deployed and select files for the upload. They may leave this page for some reasons and reopen it after some time. And it would be nice to restore the upload list in this situation to prevent users from selecting the same files again. Therefore, Image Uploader provides a possibility to save the upload list on the client side and restore it at any moment. This functionality is implemented via the SaveUploadList(), LoadUploadList(), and ResetUploadList() methods.
All these methods use the ID parameter which should be a unique integer value corresponding to the particular upload list.
Maximum number of upload lists allowed for saving is 50.
This feature can be illustrated with the examples below.
Using Image Uploader as a multistep upload wizard you can implement the following:
Another application field of this feature is the advanced upload recovering functionality. In other words, you can handle the situation when the upload process was interrupted and can be resumed with the browser restart. This functionality can be implemented as follows:
The following code sample demonstrates how to implement this functionality.
<script type="text/javascript" src="iuembed.js"> </script> <script language="javascript"> function fullPageLoad(){ //Load the upload list getImageUploader("ImageUploader1").LoadUploadList(1); } function ImageUploader1_PackageBeforeUpload() { //Save the upload list getImageUploader("ImageUploader1").SaveUploadList(1); } function ImageUploader1_AfterUpload() { //Reset the upload list getImageUploader("ImageUploader1").ResetUploadList(1); } var iu = new ImageUploaderWriter("ImageUploader", 770, 500); // Send every file in a separate package iu.addParam("FilesPerOnePackageCount", "1"); //Other parameters... //Add event listeners iu.addEventListener("PackageBeforeUpload", "ImageUploader1_PackageBeforeUpload"); iu.addEventListener("AfterUpload", "ImageUploader1_AfterUpload"); iu.fullPageLoadListenerName = "fullPageLoad"; iu.writeHtml(); </script>