Saving AVAudioRecorder output online
Is it possible to save the audio output of AVAudioRecorder on a webserver instead of saving it on the local iphone filesys开发者_如何学运维tem ? there is a method with the signature initWithURL:settings:error: but according to the documentation it only allows to save to the filesystem.
br, martin
NSMutableURLRequest *networkRequest = [[NSMutableURLRequest alloc] init];
NSInputStream* fileStream = [NSInputStream inputStreamWithFileAtPath: filePath];
[networkRequest setHTTPBodyStream:fileStream];
NSURLConnection* theConnection = [[NSURLConnection alloc] initWithRequest:networkRequest delegate:self];
This is just sample you can create full Request and Stream it to server, filePath will be physical path of file
The Best idea here is to use a library such as ASIHTTPRequest to send the saved file online after you record it.
精彩评论