Hi,
I have been trying to implement cross platform xamarin forms file picker and i'm experiencing pdf, docx or doc file picker issues. i used the code below and noticed that it only works when i pick images and doesnt work on document. i tried it on android 5.1 and also on android 9.0
- Android 5.1 works for both images and document.
Android 9.0 only picks images.
try
{
FileData fileData = await CrossFilePicker.Current.PickFile();
if (fileData == null)
return; // user canceled file pickingstring fileName = fileData.FileName; string contents = System.Text.Encoding.UTF8.GetString(fileData.DataArray); System.Console.WriteLine("File name chosen: " + fileName); System.Console.WriteLine("File data: " + contents); } catch (Exception ex) { System.Console.WriteLine("Exception choosing file: " + ex.ToString()); }