如何对UIImagePickerController
使用setHTTPBodyStream:
of挑选的图像/视频进行 HTTP POST NSMutableURLRequest
?我的意思是从文件系统(驱动器)以完整质量从资产库上传文件的最佳方法是什么?我希望setHTTPBodyStream:
使用 URL from创建 inputStream,UIImagePickerControllerReferenceURL
但它不起作用,系统无法为这个 URL 创建 inputStream ...
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
NSURL *URL = [info objectForKey:UIImagePickerControllerReferenceURL];
NSInputStream *inputStream = [NSInputStream inputStreamWithURL:URL]; // here I get just nil...
...
[URLRequest setHTTPBodyStream:inputStream];
...