tags:

views:

17

answers:

1

Hi i want to send a file to server in iphone .there is any iphone api to implement that functionality .

please reply me as soon as

thanks Pooja Rusia iphone Developer

A: 

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"];
ktaylorjohn