python azure blob storage md5 check fails on blob upload using put_block_blob_from_path -


i trying upload blob azure blob storage python sdk. want pass md5 hash validation on server side after upload.

here's code:

blob_service.put_block_blob_from_path(         container_name='container_name',         blob_name='upload_dir/'+object_name,         file_path=object_name,         content_md5=object_md5hash ) 

but error:

azurehttperror: md5 value specified in request did not match md5 value calculated server. 

the file ~200mb , error throws instantly. not upload file. suspect may comparing supplied hash perhaps hash of first chunk or something.

any ideas?

this sort of sdk bug in should throw better error message rather hitting service, validating content of large upload has chunked doesn't work. x_ms_blob_content_md5 store md5 service not validate it. on download though. content_md5 validated server body of particular request since there's more 1 chunked blobs never work.

so, if blob small enough (below blob_max_data_size) put in single request, content_md5 work fine. otherwise i'd recommend using https , storing md5 in x_ms_blob_content_md5 if think might want download http , validate on download. https provides validation things bit flips on wire using upload/download lot. if can't upload/download https 1 reason or can consider chunking blob using put block , put block list apis.

fyi: in future versions intend add automatic md5 calculation both single put , chunked operations in library solve this. next version, add improved error message if content_md5 specified chunked download.


Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -