How to include Content-MD5 header in FineUploader Azure request? -
i use content-md5 header supply azure client-side generated md5 hash of files being uploaded. how accomplish task in fineuploader?
target audience: firefox, chrome, safari, opera , ie10+.
judging this answer gather should possible @ least half of our clients run on old (slow) computers. feasible client side md5 hashing approach then?
somewhat related side question: thinking might wise set maximum file size reduce strain on md5 hashing algorithm. maybe below azure's "chunking" limit? different view: can disable chunking?
fine uploader provides direct access underlying file
or blob
object via the getfile(id)
api method. once have access this, can make use of filereader
read file/blob bytes , generate hash. make hashing easier, consider using js library sparkmd5.
the best place calculate hash in onsubmit
callback handler. since process of reading file asynchronous, have return promise in handler, supported fine uploader. once hash has been calculated, resolve promise , set hash parameter file using fine uploader's setparams api method.
can disable chunking?
yes, can, lose of benefits associated chunking, along resume feature , efficient retries should file upload fail midway though.
Comments
Post a Comment