I want to send a file to server in iPhone. Is there any iPhone API to implement that functionality?
ASIHTTPRequest is a wrapper around the network APIs and makes it very easy to upload a file. Here's their example (but you can do this on the iPhone too - save images to "disk" and later upload them.
ASIFormDataRequest *request = [[[ASIFormDataRequest alloc] initWithURL:url] autorelease];
[request setPostValue:@"Ben" forKey:@"first_name"];
[request setPostValue:@"Copsey" forKey:@"last_name"];
[request setFile:@"/Users/ben/Desktop/ben.jpg" forKey:@"photo"];
This tutorial will let you upload files to server