Upload image file to server in iOS.
In this tutorial we will upload the image as a file to JSON server .
For uploading image as a file we use multipart form as our content type .
Now jumping straightforward to our code .
Step 1 : Add AFNetworking framework to your project .
How to add AFNetworking to your project ?
Visit my previous post on AFNetworking .
Step 2: Import AFNetworking to your project.
#import <AFNetworking/AFNetworking.h>
Step 3: Add the following code in viewDidLoad to upload image as a file :
Thats all about file uploading in iOS .
Thank you :) .
This doesn't work. It is long known bug in AFnetworking. There is a workaround to do this. See here: https://github.com/AFNetworking/AFNetworking/issues/1398
ReplyDeleteHi UTSAV , it is working code. If you have any queries you can ping me anytime.
DeleteThis comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
ReplyDeletehi saurabh it will be helpful if u share the code here
ReplyDeleteI have already shared my code in this tutorial
Deletehello y dont u share code which works!!!
ReplyDeleteHi Vahida, If you have any queries you can mail me at saurabh23july@gmail.com
DeleteHi saurabh , If we want to provide some authentication to urllike username and password How can we provide?
DeleteThanks for this beautiful post IOS. It is really good for the beginners and I also liked the post.
ReplyDeleteIOS Training in Bangalore
IOS Training in Marathahalli
Nice i will keep visiting here......
ReplyDeleteThe Xmod Games Hacking APK software
How to Suway Surf with Xmodgames
I got to know more about the ios. Thanks for sharing this blog.
ReplyDeleteandroid-vs-ios