0

I'm working on an iPhone App that's HTML5/JS displayed in a single UI Webview. I'd like to add photo upload capabilities, and I'm wondering what the best approach would be to extend the iPhone app with the necessary classes to pick a photo and upload via an API. I'd also like to trigger the display of the photo picker via JS if that's possible.

I know it's possible to use a framework like PhoneGap to do this, but I don't want to migrate the whole app to a new framework yet. Also, sorry for the "how to" type question - I normally ask about specific problems after I've exhausted my efforts, but I'm pretty new to Objective C, so I'd appreciate some guidance, even if it's just a simple design explanation.

byron
  • 984
  • 3
  • 14
  • 26

1 Answers1

0

the image picker (UIImagePicker) is fairly straightforward to work with: http://developer.apple.com/library/ios/#documentation/uikit/reference/UIImagePickerController_Class/UIImagePickerController/UIImagePickerController.html

and for an API, are you sending it to an existing system? or creating your own. You just need to craft an NSMutableURLRequest with POSTED data in a multi-part format, and then handle the image portion appropriately in your server.

this might help: upload image from iPhone application

Community
  • 1
  • 1
Robot Woods
  • 5,677
  • 2
  • 21
  • 30
  • Yeah, will be sending the image to an existing API as part of an http POST. Thanks a lot for the pointers. – byron Jun 13 '11 at 22:49
  • One more thing...any recommendations on how to trigger the display of the image picker via javascript? – byron Jun 13 '11 at 22:51