在我的应用中,我必须使用POST
方法将视频上传到网络服务器。对于这个iam使用UIImagePickerController
。但是,当我从我的ImagePickerController
中选择视频时,它会显示“压缩视频”。我已将选择器allowsEditing
写入NO
,保存在照片库中的视频仅持续50秒。但我仍然是一样的。立即回应非常感谢。
答案 0 :(得分:1)
试试这个: -
NSURL *urlvideo = [info objectForKey:UIImagePickerControllerMediaURL];
NSString *str = [NSString stringWithFormat:@"%@/uploadVideoIphone.php",appUrl];
NSURL *url = [NSURL URLWithString:[str stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
NSString *filePath = [urlvideo path];
[request addFile:filePath forKey:@"uploadfile"];
[request setRequestMethod:@"POST"];
[request setDelegate:self];
[request setTimeOutSeconds:200];
[request startSynchronous];
NSLog(@"responseStatusCode %i",[request responseStatusCode]);
NSLog(@"responseString %@",[request responseString]);
[self dismissModalViewControllerAnimated:YES];