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.

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

1 Comment

i am not allowed to use external library

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.