This demo application shows how to verify integrity of uploaded files.
The application highlights the following features:
To find the information about how this demo is implemented using a specific platform, see the Samples by Platforms topic.
Hash value calculation and standard buttons replacement are not yet supported in the Java version of Image Uploader. This version will display unchanged buttons.
The check, whether the received files contain errors, is performed using hash calculation. To enable it in Image Uploader, set the value of the HashAlgorithm property to the required algorithm name. You can specify several algorithms (as it is done in this application). An appropriate hash value will be calculated and uploaded to the server along with a file. After that you can calculate hash value on the server and compare it with one generated by Image Uploader. For more details about hash calculation, see the Robust Upload Using Hash topic.
Figure 1. Application appearance of the ActiveX version.
In this sample, standard Image Uploader buttons are replaced without writing extra HTML code. They are simply replaced with the specified images. To replace the buttons as in this demo, add the following initialization properties:
And to prevent the control from reloading button images every time the user refreshes the page, enable caching of GUI controls using the CacheGuiGraphics property. The property GuiGraphicsVersion holds the version of cached images. If you want to reload them, increase this value. For more details about button replacing, see the Customizing Buttons topic.
Conditions for automatic connection recovery are specified using the AutoRecoverTimeOut and AutoRecoverMaxTriesCount properties. For more details about connection recovery, see the Configuring Automatic Upload Recovery topic.
To complete the upload started by Image Uploader, some actions on the server side should be performed. The upload script of this application is based on to the corresponding script of the Basic Demo Sample. The difference is that the script calculates hash values before saving files. It is done in the following way:
HashCodeSHA_1
, HashCodeMD5_1
, and HashCodeMD2_1
in this sample.