Skip to content
This repository was archived by the owner on May 15, 2024. It is now read-only.
This repository was archived by the owner on May 15, 2024. It is now read-only.

[Bug] FilePicker.PickAsync returns different path for Android 10 and 11. #1746

@gayugokhale

Description

@gayugokhale

Description

When I try to pick file from file explorer in Android 10 & 11 devices, It copies picked file to App specific folder. and returns the path of app specific folder instead of returning the actual file path(for example Downloads). Also the file copied to app folder can not be opened so getting corrupt file error when trying to access that file path in the code.

Steps to Reproduce

 string filepath = string.Empty;
    async Task PickAndShow()
    {
        try
        {
            var result = await FilePicker.PickAsync(PickOptions.Default);
            if (result != null)
            {
                filepath = result.FullPath;
            }
        }
        catch (Exception ex)
        { }
    }

the result.FullPath contains path like this /storage/emulated/0/Android/data/com.companyname.appname/cache/2203693cc04e0be7f4f024d5f9499e13/8bba0b6ad0d24292922d2bf729d82856/ItemMaster_20210408103306.xlsx.

Expected Behavior

It should contain actual path for that file. In this case Downloads folder path.

Actual Behavior

Not getting correct path for android 10 & 11. But working fine on Android 7.1.2

Basic Information

  • IDE: Visual Studio & Visual studio for mac
  • Platform Target Frameworks:
    • Android: Android 10 & 11
  • Affected Devices: Not working on Samsung M31(Android 11) & Realmi narzo 20A(Android 10).
  • Working on : Redmi 4(Android 7.1.2)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions