Can't upload images with updated API
tiun.hl
Registered Users Posts: 6 Big grins
Hi,
Since the "smugmug.images.upload" method has been deprecated I rewrote my Perl script for uploading.
Withe the new code, I found that small images(53KB) can successfully upload but not larger ones (like 1.3MB).
The following is the reply for the small image upload:
The following is the reply for the larger image upload:
The "upload log" in the control panel shows the problem is "incomplete file".
Is there any upload file size limit??? Or what should I modify?
Thanks a lot!!
Since the "smugmug.images.upload" method has been deprecated I rewrote my Perl script for uploading.
Withe the new code, I found that small images(53KB) can successfully upload but not larger ones (like 1.3MB).
use File::Slurp; use HTTP::Request::Common; ......... my $image = read_file($path, binmode => ':raw'); $file_size = length($image); $imagemd5 = md5_hex $image; $upload_ua = LWP::UserAgent->new; $upload_ua->cookie_jar({}); $upload_reply = $upload_ua->request(PUT 'http://upload.smugmug.com/' . $filename, 'X-Smug-AlbumID' => $albumid, 'X-Smug-SessionID' => $sessionid, 'X-Smug-Version' => '1.2.2', 'X-Smug-FileName' => $filename, 'Content-MD5' => $imagemd5, 'Content-Length' => $file_size, 'X-Smug-ResponseType' => 'JSON', Content => $image); ...........
The following is the reply for the small image upload:
{"stat":"ok","method":"smugmug.images.upload","Image":{"id":1282795082,"Key":"rmSHKdX","URL":"http://tiun.smugmug.com/\u7279\u6b8a\u7684\u65e5\u5b50/110508\u6bcd\u89aa\u7bc0/16956127_mJ3C6g#1282795082_rmSHKdX"}}
The following is the reply for the larger image upload:
{"stat":"fail","code":61,"message":"We're sorry, but that upload got interrupted somewhere along the way. Please try again."}
The "upload log" in the control panel shows the problem is "incomplete file".
Is there any upload file size limit??? Or what should I modify?
Thanks a lot!!
0
Comments
Incomplete file means that we didn't get the full file that we were expecting.
Let me outline an example...
You attempted to upload a file DSC_0462.jpg, the reported Content-Length was 1333098 bytes, but the file we received was only 66243 bytes in length. This typically means that the connection got close prematurely.
Hope this helps.
David
SmugMug API Developer
My Photos
I'm getting occasional reports of this from users of my Lightroom plugin. Nothing about the plugin or Lightroom has changed, but I know your backend processing has changed, so that's where I'm guessing the issue lies. But I don't know. What should I tell users when they report it to me?
c'mon jeff, not really show how us not receiving the full file is an issue with our backend, sounds more like a connectivity issue.
have any users who are experiencing this issue contact the helpdesk, mark it my attention if they want.
SmugMug API Developer
My Photos
Also, to put the error rate in perspective, over the last 7 days, your uploader has uploaded 178,728 images of which 398 failed. I'll let you do the math on that.
SmugMug API Developer
My Photos
Using HTTP::Request instead of "HTTP::Request::Common" fix this problem.
Thanks for your help!
I saw you post in the forums that you had a Perl script for uploading images to SmugMug. I have been struggling with modifying Marco's Gallery 2 Uploader and have had no success.
I tried to find your script, but the link is dead: http://www.warrenc.com/blog/ezsmugup
Do you have a new link for your script? I would really appreciate it!