PDA

View Full Version : Wrong MD5Sum Reported By Server


adamc
Jul-27-2010, 07:43 AM
I have been able to upload files to the server successfully, but suddenly now I'm getting a message saying that my md5 is wrong.
The weird thing is that the one it is expecting is 33 characters instead of 32. For some reason it is inserting a random 0 into the expected md5 sum.

If I remove the MD5 from my header, it works fine. If this is really broken server-side, and since nobody is reporting it, I'm guessing most other API users don't use MD5 either?

{"stat":"fail","code":60,"message":"corrupt file
(ByteCount given: 5192, received: 5192.
MD5Sum given: d170fc7e547af33c15b57593f5ca0c4,
actual: d170fc7e547af33c15b57593f50ca0c4.)"}

devbobo
Jul-28-2010, 07:41 PM
Hey Adam,

Actually, I'd say that the overwhelming majority of uploaders send the md5 (including SmugMug's own uploaders).

Is it possible to get some more information like...

- what's this programmed in ?
- what specific upload endpoint are you using ? PUT, Raw POST or Multi-Part POST ?

Could you please also send me a copy of the original file or link me to it uploaded on SmugMug so that I can validate it.

Thanks,

David

adamc
Jul-29-2010, 07:36 PM
I am doing this in Java using httpclient 4.1 with a Put. As I mentioned, the really weird thing is that the server mentioned a 33 bit sum. I just tried it again by only uncommenting the md5 code. I sent 2 pics, one was ok, the other got the corruption error. I'm going to stop using md5 for my app for now. I'll pm you the two pics I just sent. However, an extra char in an md5 is suspect imho.

adam

Hey Adam,

Actually, I'd say that the overwhelming majority of uploaders send the md5 (including SmugMug's own uploaders).

Is it possible to get some more information like...

- what's this programmed in ?
- what specific upload endpoint are you using ? PUT, Raw POST or Multi-Part POST ?

Could you please also send me a copy of the original file or link me to it uploaded on SmugMug so that I can validate it.

Thanks,

David

cschubert
Sep-03-2010, 01:05 PM
I'm having a similar problem. I try to develop a smugmug-uploader using Cocoa. Whenever I try to submit the MD5Sum of an image while uploading the upload fails and I get a "corrupt file" message. The strange things: the two reported MD5Sums are actually the same. Here are two examples:

{"stat":"fail","code":60,"message":"corrupt file (ByteCount given: 325835, received: 325835. MD5Sum given: 91d2161faec8d13a19c2fff3e8db51d3, actual: 91d2161faec8d13a19c2fff3e8db51d3.)"}

{"stat":"fail","code":60,"message":"corrupt file (ByteCount given: 220454, received: 220454. MD5Sum given: 1f135518d60bb47d2735100b7a0cfc4f, actual: 1f135518d60bb47d2735100b7a0cfc4f.)"}

Without specifying the MD5Sums the uploads work fine. Links to the files

http://cschubert.smugmug.com/Landscapes/Rombergpark/10486555_u7xWQ#993359624_Vi8cE

http://cschubert.smugmug.com/Landscapes/Rombergpark/10486555_u7xWQ#993359595_g73XL

Some details: I use Mac OS 10.6.4, Objective-C (Cocoa with Appkit 6.6.6, Core-Foundation 6.6.3), http-method put, endpoint http://upload.smugmug.com/, SmugMug Api 1.2.0

Thanks and cheers,
Christoph

Marc Rochkind
Dec-14-2010, 10:38 AM
Getting the exact same result as Christoph: upload works OK without MD5; with MD5 it fails and the two MD5 strings reported in the error message are identical.

****** UPDATE ******
Changed my hex to use lower case (e.g., ffee) instead of upper (FFEE), and it now works. (Error message used lower case even when I sent upper, indicating that the comparison was not case insensitive, but the formatting of the error message reported the MD5s as lower case. Just need to get the guy who did the error message to change the code itself. ;-) )

--Marc