jfversluis / FilePicker-Plugin-for-Xamarin-and-Windows

FilePicker Plugin for Xamarin and Windows
MIT License
157 stars 80 forks source link

Cant find path for a file in android #161

Closed DannyTimms closed 4 years ago

DannyTimms commented 4 years ago

Expected Behavior

Find a file and return the correct path in the object /internal storage/download/complaints policy.docx

Actual Behavior

Finds file but returns a file path which does not exist. content://com.android.providers.downloads.documents/document/197

Steps to Reproduce the Problem

  1. Select a file
  2. Attempt to work with the file
  3. Exception describing the file cannot be found at the specified location

Specifications

vividos commented 4 years ago

Unfortunately your expectation is wrong. On Android the FilePath often is a content:// URL which can on only be accessed using ContentProvider class from Android, or you're using the GetStream() method to access the data directly.

DannyTimms commented 4 years ago

This may be so - I found a work around for this. When selecting the file, it points to a "Downloads" folder in the file selector, if you ignore this option, browse the device instead and THEN point to downloads folder, it works fine.