How to pick a file from Device(iOS, Android)

ManishpManishp USMember ✭✭

Hi All,

I have deployed app using Xamarin Form.
I have some requirement to pick a file( images, documents, videos except .zip file) from device.
Can you please suggest? It is very urgent for me.

Answers

  • HunumanHunuman GBMember ✭✭✭✭

    Hi @Manishp

    You can use the File Picker Plug-in that can be found here.

    Hope this helps,

    Tim

  • ManishpManishp USMember ✭✭

    Actually I tried File Picker but getting error for iOS : "NSInternalInconsistencyException Reason: Application initializing document picker is missing the iCloud entitlement.
    Is com.apple.developer.icloud-container-identifiers set"

    I have setup 'com.apple.developer.icloud-container-identifiers' but still it is not working.
    Please suggest.

  • oliveiravitor3oliveiravitor3 BRMember ✭✭

    Looking for an example of Xam.Plugin.FilePicker, I found this

    My Example:

    try
    {
    
        FileData filedata = await CrossFilePicker.Current.PickFile();
        if (filedata == null)
            return;
    
        System.Diagnostics.Debug.WriteLine(filedata);
        System.Diagnostics.Debug.WriteLine(filedata.FileName);
        System.Diagnostics.Debug.WriteLine(filedata.DataArray);
        System.Diagnostics.Debug.WriteLine(filedata.ToString());
    }
    catch (Exception ex)
    {
        System.Diagnostics.Debug.WriteLine(ex);
    }
    
  • himvchimvc Member ✭✭

    that is Working for Android but i need for ios , and how to set icloud permission to get data

  • Sushil_KumarSushil_Kumar Member ✭✭

    https://www.nuget.org/packages/Xam.Plugin.FilePicker/ ,this link is working for Android, I am also try for iOS but getting errors , please suggest me any document that I follow and solve my issues.

    thanks.

Sign In or Register to comment.