title: iPhone SDK : How to save a image as a file and POST it back to PHP server?
body: <p>I'm look for a solution to upload an image file to PHP server</p>
  
  <p>I find some tutorial to get a photo from <a href="http://www.youtube.com/watch?v=CmZjsTW0G94" rel="nofollow noreferrer">this video</a> </p>
  
  <p>and you can get source code <a href="http://davidporterapps.com/SourceCode/iPhoto.zip" rel="nofollow noreferrer">here</a> </p>
  
  <p>How can I use an IBAction to send the photo to a URL server </p>
  
  <p>for example I give it a URL:<a href="http://someaddress/photo_upd.php" rel="nofollow noreferrer">http://someaddress/photo_upd.php</a></p>
  
  <p>or more specific, <strong>HOW TO CONVERT IMAGE I GET FROM CAMERA -> NSDATA ???</strong></p>
  
  <p>I think <a href="https://stackoverflow.com/questions/936855/file-upload-to-http-server-in-iphone-programming">this discussion</a> will be help,but I don't know how to use it ...</p>
  
  <p>this is my program main function,I use a camera to take a photo </p>
  
  <p>and I press a button It will send the image and the GPS location</p>
  
  <p>now I only can send GPS location,but don't know how to upload the image</p>
  
  <p>Hope someone know the solution !</p>
  
  <p>Great thanks !!!</p>