Aurigma Image Uploader 6.5 Dual
ImageUploader.HashAlgorithm Property
Algorithm to generate a hash value for each file to upload to the server.
Syntax
Initialize
JavaScript
<script type="text/javascript" src="iuembed.js"> </script> <script type="text/javascript"> var iu = new ImageUploaderWriter("ImageUploaderID", 610, 500); //...other params... iu.addParam("HashAlgorithm", ""); //...other params... iu.writeHtml(); </script>
Get/Set Value in Runtime
JavaScript
getImageUploader("ImageUploaderID").setHashAlgorithm(value);
value = getImageUploader("ImageUploaderID").getHashAlgorithm();Property Value
A string value which specifies what hash algorithm to use. If an empty string is specified, no hash value is calculated.
Possible values are listed in the table below.
| Hash algorithm name | Description |
|---|---|
| SHA | SHA hash algorithm. |
| MD2 | MD2 hash algorithm. |
| MD5 | MD5 hash algorithm. |
You can specify several hash algorithms separated by semicolon.
Default value is "".
Remarks
To get hash value on the server side, you should extract POST field which is named in the following way: HashCodeXXX_N , where XXX is the string value specified in this property (algorithm name), and N is the index of the file in the request.
When hash value is added to the request, it is encoded with Base64 algorithm. So it is necessary to decode it back. Most server platforms already have facilities to work Base64 encoding, however if you have problems with it, refer RFC 3548.
If you specify several algorithms, several hash values will be sent (for each algorithm). E.g. if you specify a value MD5;SHA, you will get the following POST fields:
- HashCodeMD5_1, HashCodeMD5_2, etc.
- HashCodeSHA_1, HashCodeSHA_2, etc.