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

FilePicker Plugin for Xamarin and Windows

Primary LanguageC#MIT LicenseMIT

FilePicker Plugin for Xamarin.Forms

Simple cross-platform plug-in that allows you to pick files and work with them.

The original project can be found here, but seems abandoned, this one was forked and further developed.

Build status

Stable Build status NuGet version

NuGet: https://www.nuget.org/packages/Xamarin.Plugin.FilePicker/

Development feed (possibly instable) Build status

Add this as a source to your IDE to find the latest packages: https://ci.appveyor.com/nuget/filepicker-plugin-for-xamarin

Setup

  • Install into your Xamarin.Android, Xamarin.iOS, Xamarin.Forms, Xamarin.Mac project and Client projects.

Platform Support

Platform Supported Version Remarks
Xamarin.iOS Yes iOS 6+
Xamarin.iOS Unified Yes iOS 6+
Xamarin.Android Yes API 10+
Windows Phone Silverlight No
Windows Phone RT Yes 8.1+ Up to package version 1.4.x
Windows Store RT Yes 8.1+ Up to package version 1.4.x
Windows 10 UWP Yes 10+
Xamarin.Mac Yes * 10.12+

* The Xamarin.Mac implementation has only been tested on MacOS 10.12.

API Usage

Call CrossFilePicker.Current from any platform or .NET Standard project to gain access to APIs.

Example

        try
        {
            FileData fileData = await CrossFilePicker.Current.PickFile();
            if (fileData == null)
                return; // user canceled file picking

            string 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());
        }

IMPORTANT

Android: The WRITE_EXTERNAL_STORAGE & READ_EXTERNAL_STORAGE permissions are required.

iOS: Need Configure iCloud Driver for your app

Contributors

Thanks!

License

MIT Licence