使用 ASIFormDataRequest 将 HDvideo 上传到服务器。但是上传需要很长时间。
我的代码是
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
if (movieUrl != Nil) {
NSData *videoData = [NSData dataWithContentsOfURL:movieUrl];
[request addData:videoData withFileName:[movieUrl lastPathComponent] andContentType:@"audio/mp4" forKey:@"video"];
[request setRequestMethod:@"POST"];
//
[request setTimeOutSeconds:600];
[request setDelegate:self];
//
[request setUploadProgressDelegate:progressView];
[request startSynchronous];
其中movieurl是从imagepickerdidfinish返回的url
movieUrl = (NSURL*)[info objectForKey:UIImagePickerControllerMediaURL];