• Gear
  • Shots
  • Photo Craft
  • Video
  • Wide Angle
  • Support
  • New Stuff
  • More
Support SmugMug APIs, Hacks & Tricks System error 5 with proven Objective-C code when uploading a photo

FAQtoid

Ever wanted to create an Avatar? Creating an Avatar!

Searching Dgrin with Google Searching with Google

Dgrin Challenges

Congratulations to the Winner of DSS #128 (Sunrise or Sunset), ShootingStar.

The next Dgrin Challenge DSS #129 (Silhouette Revisited ) is open for entries through May 27th, 2013 at 8:00pm PDT.

As always, we look forward to your participation but please do take a moment to read through the rules before posting your entry.

Past DSS Challenge Winners, DSS Challenge Rules, and other important DSS Challenge information is here.

Need some help with Accessories?

Tutorials

Ever find yourself wondering just how someone managed to create an image using different effects?

Here are three simple tutorials we hope will encourage you to try something new.

The Hot Seat

A lifelong interest in landscape photography has led Eyal Oren to make a study of his adopted hometown of Marblehead, MA. As you can see, his dedication is paying off!

Africa!

Dgrinners Harryb, Pathfinder, and others joined Andy Williams and Marc Muench on Safari in East Africa recently. Here are some awesome threads to check out!

 
Thread Tools Display Modes
Old Oct-04-2012, 08:05 AM
#1
sundialsoft is offline sundialsoft OP
Beginner grinner
System error 5 with proven Objective-C code when uploading a photo
My iphone app PhotoKing has been live for many months. When testing some iOS 6 changes unrelated to SmugMug code photo uploads are failing:-
code = 5;
message = "system error";
method = "smugmug.images.upload";
stat = fail;
I can create an album & view photos so everything else works & I use very similar code for PhotoBucket and Tumblr that also still works for photo upload. I reinstalled the app & logged on again just to be sure.

As my code has not been changed I would like to ask if there is anything different at the server end that's not obvious to me? Any parameter changes etc?
I have been back through the api docs & ran lots of debugging on my app to no avail.
I use http://upload.smugmug.com and the Oauth multi-part code I use has been bullet proof for many months however I can't remember uploading to SmugMug for quite a while.

Just to confirm this is the latest API, tested on multiple devices. Oauth code works for several other sites inc Photobucket.
My account uploads fine via camera awesome. The original code from Apple appstore also fails now so definitely not something I've done to the code.

As this issue is holding up an iOS6/iPhone 5 update for my photo app on the app store I will wait one week for any feedback then if I can't fix it will have to remove SmugMug from the app & replace it with one of the other photo sharing services. It was an easy integration to do but it's not mainstream so I will have to pull it if there's no support. Fingers crossed someone replies.

update: I pointed a port sniffer at Camera Awesome. It's using an http PUT with OAuth. I have been using a multi-part http POST. Maybe analysing the working PUT data will help.

Regards

Ian
sundialSoft

Last edited by sundialsoft; Oct-07-2012 at 07:52 AM. Reason: additional info
Old Oct-10-2012, 04:21 PM
#2
SamirD is offline SamirD
Huntsville Car Scene.com
SamirD's Avatar
I hope someone chimes in. I think I've noticed a problem with the same method, but haven't had time to debug it.
__________________
Pictures and Videos of the Huntsville Car Scene: www.huntsvillecarscene.com
Want faster uploading? Vote for FTP!
Old Oct-18-2012, 11:55 PM
#3
sundialsoft is offline sundialsoft OP
Beginner grinner
Looks like SMugMug support is non-existent. I will give an alternative method a try & if that does not work will have to rip it out of my app & put in something else. Will update Monday when I will get back to this.
Old Oct-19-2012, 02:14 AM
#4
rainforest1155 is offline rainforest1155
with a Heroes touch
rainforest1155's Avatar
Ian,
Sorry you haven't received another reply yet. While I'm no API expert, it might be helpful if you could share details, like the full request you send and what you receive back as the response.
__________________
Sebastian
SmugMug Support Hero

look on the bright side
http://www.SebastianHosche.com
Old Oct-23-2012, 04:24 AM
#5
sundialsoft is offline sundialsoft OP
Beginner grinner
Additional info
Simon, the error coming back is as previously stated:-
code = 5;
message = "system error";
method = "smugmug.images.upload";
stat = fail;
My post params are:-
AlbumID=22591969&Caption=Test&FileName=photoKing&P retty=true&ResponseType=JSON&SessionID=47f38ddf51f 583166b410bcb6e6bf011&Version=1.3.0&oauth_consumer _key=<MYKEYHERE>&oauth_nonce=117CB9AE-4EF0-49FD-849D-BE10E0714614&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1350994669&oauth_token=<MYTOK ENHERE>&oauth_version=1.0

The code I use (which then used separate OAUTH code to do some work) is:-

NSString *aPath = @"";// because of special end point no extra path needed http://upload.smugmug.com/
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
appDelegate.photoUploadMode = @"SMUGMUG";
NSMutableDictionary *fullParams = [[NSMutableDictionary alloc] initWithCapacity:20];
[fullParams setObject:@"photoKing" forKey:@"FileName"];
if(smugMugStep == addPhotoAfterNewAlbum)
{
[fullParams setObject:albumID forKey:@"AlbumID"];// id set when album create returned v
}
else {
NSString *ID = [NSString stringWithFormat:@"%d", [[photoalbumIDs objectAtIndex:selectedIndex] intValue]];
NSLog(@"album %@",ID);
[fullParams setObject:ID forKey:@"AlbumID"];//
}
[fullParams setObject:@"1.3.0" forKey:@"Version"];
[fullParams setObject:message forKey:@"Caption"];
[fullParams setObject:@"JSON" forKey:@"ResponseType"];
[fullParams setObject:@"true" forKey:@"Pretty"];
[fullParams setObject:self.smugMugSessionID forKey:@"SessionID"];

aRequest = [[OAuthASIFormDataRequest alloc] initWithParamsllParams path:aPath];
[aRequest setDelegate:self];
[aRequest setRequestMethod:@"POST"];//POST
[aRequest setPostFormat: ASIMultipartFormDataPostFormat];
[aRequest setDidFinishSelector:@selector(imageUploadRequestS ucceeded:)];
[aRequest setDidFailSelector:@selector(imageUploadRequestFai led:)];
[aRequest setUploadProgressDelegate:self.sendBar];
// Upload an image
[aRequest addData:media withFileName:@"photoUpload" andContentType:@"image/jpeg" forKey:@"userfile"];
[aRequest startAsynchronous];

Note that this code worked fine dozens of times & stopped working in the past few months.
Tell The World!  
Tags
upload error , uploading
Similar Threads Thread Starter Forum Replies Last Post
Generate customised HTML code for galleries... encosion SmugMug APIs, Hacks & Tricks 13 Jul-22-2009 07:34 AM
>>> LPS#10 Feedback thread Shay Stephens The Dgrin Challenges 57 Aug-13-2007 01:03 AM
Here's the unofficial feedback thread for LPS 9--go nuts! indiegirl The Dgrin Challenges 51 Jul-27-2007 07:20 PM
Odd, quarter photo fragmented pics when uploading with the Exporter for Aperture MacLoyal SmugMug APIs, Hacks & Tricks 0 Jun-10-2007 08:52 PM
What the heck is going on here? MichaelKirk SmugMug Customization 2 Dec-04-2006 08:22 AM


Thread Tools
Display Modes

Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump