Take a look at ASIHTTPRequest: http://allseeing-i.com/ASIHTTPRequest/
The following is a snippet of code. I am using ASIHTTPRequest to upload a file.
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url]; [request addPostValue:token forKey:@"token"]; [request setFile:recorderFilePath forKey:@"thefile"]; [request startSynchronous];
NOTE. the variable recorderFilePath is the path to the sound file, this is the file that I created in the application document directory, added to the code header code, will help you get the directory of your document.
#define DOCUMENTS_FOLDER [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]
source share