OK. I am pulling my hair out over this. I am using the following code to produce a upload via FTP of a photo selected by the user.
using (WebClient client = new WebClient())
{
client.Credentials = new NetworkCredential("[username]", "[password]");
client.UploadFile("XXXXXXXXXX" + destinationName, "STOR", sourceFile);
}
This being a standard .net implimentation. The problem being then source File. I have implimented a click event, along with a return event from.
protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)
{
if ((requestCode == PickImageId) && (resultCode == Result.Ok) && (data != null))
{
}
}
Here is the problem which is driving me insane. I need the physical path of the selected photo returned from the OnActiveResult event, in order for the FTP to upload properly.
I've tried;
Android.Net.Uri uri = data.Data;
physicalAddress = Convert.ToString(data.Data);
physicalAddress = Convert.ToString(uri);
None of these return the path just "content:\android.provider.media\documents\document\image%123164"
This when provided to the function above, returns an error as the provided source file doesnt exist.
Pulling hair out! please help!