无法在iOS上使用request.Addfile从Gallery上传图像

时间:2015-06-12 14:33:19

标签: ios xamarin xamarin.ios restsharp

我正在尝试使用UIPickerViewController从Gallery上传图像,但使用request.Addfile()会收到FileNotFound错误。我正在做什么或者只是不可能用iOS这样做?

代码如下:

NSUrl referenceURL = e.Info[new NSString("UIImagePickerControllerReferenceUrl")] as NSUrl;

var request = new RestRequest("account/imageprofile/", Method.POST);
request.AddFile("path_picture",referenceURL.AbsoluteString);
request.AddHeader ("Authorization", "Bearer " + token);

client.ExecuteAsync(request, rsResponse)

希望有人可以帮助我,因为我无法在任何地方找到解决问题的方法..

提前致谢!

1 个答案:

答案 0 :(得分:0)

我知道我迟到了3年,但是为了将来参考那些偶然发现的人。尝试

request.AddFile("path_picture",referenceURL.Path);
相关问题