Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Take picture with iPhone API and transfer it to a server

I have written an cocoa application to take a picture on the iPhone. I need to transfer the images taken to somewhere besides the iPhone namely another server. Does anyone know how I can accomplish this?

Thanks, Joe

like image 601
Atma Avatar asked Mar 31 '09 00:03

Atma


People also ask

How do I insert an image into API?

You can insert an image into a document using the InsertInlineImageRequest method. You can optionally specify a size to resize the image. The image must be publicly accessible using the URL that you provide in this method. ));

How do you transfer photos from iPhone to PC computer?

Open the Photos app on your computer. The Photos app shows an Import screen with all the photos and videos that are on your connected device. If the Import screen doesn't automatically appear, click the device's name in the Photos sidebar. If asked, unlock your iOS or iPadOS device using your passcode.


1 Answers

First get a server and figure out what kind of phone <---> server API you want to use. There are any number of ways it can work. A simple and common scheme is a REST API with photos being uploaded via HTTP POST.

The basic scheme would be something like:

  1. Take picture
  2. Convert to JPG (there's a function for this)
  3. Construct HTTP POST using the NSURL* classes
  4. Set JPG data as POST body (or one part of a mutipart form post)

Converting to base64 should not be necessary.

If you've never put together any kind of server API, there are any number of examples available. Most photo-sharing sites have public APIs which may be useful references.

like image 154
Tom Harrington Avatar answered Oct 11 '22 12:10

Tom Harrington