Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

How to get the file path of an image and send it to the server?

Hi everyone. Im currently learning Xamarin.Forms and I'm building my first application. Im using Xam.Media.Plugin to select or take a photo and save it to my server and It's working fine. But somehow, my requirements shifted so I looked around for another plugin and I discovered matheusneder/Xamarin.Forms.ImagePicker. This plugin covers all of my image processing requirements aside from it doesnt seem to save the image to the server. My REST API returns null for the image passed.
This is my code in selecting the image:
if (imageSource != null)
{
image.Source = imageSource;
new Alert("File path", imageSource.ToString(), "");
}
and this results to the file path being : /data/user/0/com.mysample.app/cache/cropped7799234235.jpg
In MediaPlugin, the file path result is : /storage/emulated/0/Android/data/com.mysample.app/files/Pictures/temp/IMG_20200915_104932_12.jpg

Im guessing that this somewhat related to file path? Any ideas on how to achieve the latter result?

Answers

Sign In or Register to comment.