を使用してビデオを Web サーバーにアップロードしようとしていますUIImagePickerController
。これを行う方法を提案するか、サンプルを提供してください。
質問する
1328 次
1 に答える
0
-(void)imagePickerController:(UIImagePickerController *)ピッカー didFinishPickingMediaWithInfo:(NSDictionary *)info
{
NSURL *urlvideo = [info objectForKey:UIImagePickerControllerMediaURL];
//urlvideo contains the URL of that video file that has to be uploaded. Then convert the url into NSString type because setFile method requires NSString as a parameter
NSString *urlString=[urlvideo path];
NSLog(@"urlString=%@",urlString);
NSString *str = [NSString stringWithFormat:@"path of server"];
NSURL *url = [NSURL URLWithString:[str stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
[request setFile:urlString forKey:@"key foruploadingFile"];
[request setRequestMethod:@"POST"];
[request setDelegate:self];
[request startSynchronous];
NSLog(@"responseStatusCode %i",[request responseStatusCode]);
NSLog(@"responseStatusCode %@",[request responseString]);
}
于 2012-10-11T12:17:15.317 に答える