0

what is equivalent iphone (objective c) code to

<form method="post" enctype="multipart/form-data" action="page2.php">
<input type="file" name="File">
<input type="submit" name="uploadbtn">
</form>

i want to upload file from iphone to server.

Wasim A.
  • 9,660
  • 22
  • 90
  • 120

1 Answers1

3

You will need to POST from your device to your server.

You can use the ASIHTTPRequest library to do this or use the built in NSURLConnection class.

Look specifically at the "Sending a form POST with ASIFormDataRequest" section in the ASIHTTPRequest documentation.

If you can't use a third party library you will have to use NSURLConnection. You can find examples of how to use NSURLConnection here: File Upload to HTTP server in iphone programming

Community
  • 1
  • 1
Larry Hipp
  • 6,205
  • 3
  • 26
  • 31