I am making a Native IOS app using C#. I have a registration form and i am sending form data with image. but i am unable to send image as my UIImage control does not contains its path or name.I am sending Form to web api in multipart . text field data is uploading but image is not being upoloaded .
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
Here's how you can pick image from Camera/Gallery onto an
UIImageView
, and then upload;Use UIImagePickerController for selecting image from Gallery/Camera
Use the below function on clicking a button or on your ImageView to bring a pop for to select between Camera/Gallery:
Now the actions:
You may need to add following two permissions in your Info.plist to access Camera/Gallery
They're both String, and Value can be something like "YourAppName needs access to use your camera"
And finally to upload image as multipart:
First convert the image to byte array
And finally to post the image, I use modernhttpclient