我已经用Iphone编写了客户端代码。
self.postRequest = [[ASIFormDataRequest alloc] initWithURL:[NSURL URLWithString:@"http://Services/UploadVideo.asmx"]];
NSString *urlString=[self.videoURL path];
NSLog(@"urlString=%@",urlString);
[self.postRequest setFile:urlString forKey:@"videoUrl"];
[self.postRequest setRequestMethod:@"POST"];
[self.postRequest setDelegate:self];
[self.postRequest setDidFailSelector:@selector(postFailed:)];
[self.postRequest setDidFinishSelector:@selector(postSuccessful:)];
[self.postRequest startAsynchronous];
LOG output:// urlString=/private/var/mobile/Applications/09108E9E-1494-4C25-8C3E-328B95BD1504/tmp/capture-T0x1e569fd0.tmp.w37766/capturedvideo.MOV
如何捕获并保存在服务器上?提前谢谢..
发布于 2013-04-17 19:25:35
首先,您需要将视频转换为nsdata
NSData *data = [NSData dataWithContentsOfFile:video_url];
然后将base64转换为base64字符串(需要为nsdata下载单独的文件)
NSString *encodedString=[data base64EncodedString];
因此,最后可以将编码后的字符串发送到.net服务器(需要在.net服务器中对编码后的字符串进行解码以检索视频)
上面的代码是为我工作的图像转换(我认为它也可以为视频工作)
https://stackoverflow.com/questions/16058448
复制相似问题