MD5_CHECKSUM error while uploading a file

28 views Asked by At

I'm uploading the file like this as mentioned in their public document.

String path = getClass().getClassLoader().getResource("SmallImage.png").getPath();
String name = "SmallImage.png";
StoredObject object = container.getObject(name);
UploadInstructions uploadInstructions = new UploadInstructions(new File(path));
object.uploadObject(uploadInstructions);

The library itself generates the Etag and adds it to the PUT request header. But then I get the MD5_CHECKSUM error when I try to upload. I don't understand why that MD5 checksum is rejected the the server when the library itself is generating the etag.

The workaround of not supplying the etag does not work either since the library mandatorily adds the etag header here in UploadObjectCommandImpl.prepareUpload method.

Please suggest what can be done here to solve this problem.

0

There are 0 answers