1.2.0 images.uploadFromURL correct usage
rkalla
Registered Users Posts: 108 Major grins
I'm curious about the ByteCount and MD5Sum arguments needed for the uploadFromURL method.
The only way I can think (off the top of my head) of how to get those two values is to actually download the image first from the URL, count it's bytes, then do an MD5 calculation on it *then* make the call to uploadFromURL with that information.
In which case I might as well just call images.upload since I already have the image local, know it's ByteCount and MD5Sum.
I'm a little fuzzy on either (a) how to compute these values without downloading the images first or (b) the usefulness of the uploadFromURL method if I do infact have to do what I mentioned above...
Maybe I"m just being dense and missing something obvious? :dunno
The only way I can think (off the top of my head) of how to get those two values is to actually download the image first from the URL, count it's bytes, then do an MD5 calculation on it *then* make the call to uploadFromURL with that information.
In which case I might as well just call images.upload since I already have the image local, know it's ByteCount and MD5Sum.
I'm a little fuzzy on either (a) how to compute these values without downloading the images first or (b) the usefulness of the uploadFromURL method if I do infact have to do what I mentioned above...
Maybe I"m just being dense and missing something obvious? :dunno
0
Comments
This feature seems nice, but I agree. The bytes and MD5 should be optional. Maybe it is and just not noted in the API doco in the Wiki.
-Mitch
I double-checked, it returns error-code 5 (System Error) if you don't include the ByteCount and MD5Sum.
Also, in addition to smugmug.images.upload not working (returning null every time), it seems that this method does exactly the same. I couldn't get any uploads to work.
NOTE, the uploadFromURL reply looks like this:
Which I guess it shouldn't for two reasons:
I guess we'll have to wait until David gets back.
kallasoft | The "Break It Down" Blog
If another service provided such information, then providing both ByteCount and MD5Sum would provide another level of fault tolerance.
SmugMug API Developer
My Photos
At the top of my last reply I mentioned that not including the MD5 or ByteCount causes the op to fail with:
Bug then?
kallasoft | The "Break It Down" Blog
SmugMug API Developer
My Photos
kallasoft | The "Break It Down" Blog
SmugMug API Developer
My Photos