Forum Xamarin.Forms

List all multimedia files

Hello everyone

I am carrying out a project for the company where they have to upload photographic evidence of certain places, I want to know how I can list all the media files of the device without having to choose them previously (as is done with Xam.Plugin.Media), that is, I need Load them before starting the app.

I have tried to read all the phone folders but I have not been successful, I can only read the ones generated by the app.

Beforehand thank you very much.



  • YelinzhYelinzh Member, Xamarin Team Xamurai
    edited September 2019

    Use System.IO.Directory.GetFiles method to get the names of specified files.

    var files = System.IO.Directory.GetFiles(path);


  • Good day Jarvan, thank you very much for responding.

    Yes, I tried to get the files through the System.IO library; also through Enviroment.GetPath but it only returns the files that I generate in my application, not those that are stored by other applications on the device.

    I don't know the location where the media files are stored.

    Thank you.

  • YelinzhYelinzh Member, Xamarin Team Xamurai
    edited September 2019

    To search also media files in subfolders, use parameter SearchOption.A­llDirectories.


    public static string[] GetFiles(string path, string searchPattern, SearchOption searchOption);

    Tutorial about the method.

    string[] filePaths = Directory.GetFiles(“/storage/emulated/0”, "*.mp4", SearchOption.AllDirectories);
Sign In or Register to comment.