# File Picker on Magic Leap 2

**URL:** <https://forum.magicleap.cloud/t/file-picker-on-magic-leap-2/5434>\
**Category:** Unity Development\
**Tags:** development, unity\
**Created:** [March 31, 2025, 4:58pm UTC](https://forum.magicleap.cloud/t/file-picker-on-magic-leap-2/5434 "2025-03-31T16:58:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexander.gall](https://avatars.discourse-cdn.com/v4/letter/a/ed655f/32.png) [@alexander.gall](https://forum.magicleap.cloud/u/alexander.gall)\
**Post date:** [March 31, 2025, 4:58pm UTC](https://forum.magicleap.cloud/t/file-picker-on-magic-leap-2/5434/1 "2025-03-31T16:58:02Z")

</div>

I’m trying to use a file picker on Magic Leap 2 with Unity and MRTK3 that allows users to browse and select a file using the system’s file browser. The picker should return the full file path (including the filename and extension) so I can access the selected file within my Unity application.

**Unity version** : Unity 6 (6000.0.37f1)  
**ML2 OS version** : 1.12.0  
**Host OS** : Windows 11  
**MRTK version** : MRTK3

Here’s the method I’m currently trying to use for Magic Leap 2:

```auto
private async Task<string> FilePicker_Android()
{
    using (AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
    using (AndroidJavaObject currentActivity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity"))
    using (AndroidJavaObject intent = new AndroidJavaObject("android.content.Intent", "android.intent.action.OPEN_DOCUMENT"))
    {
        intent.Call<AndroidJavaObject>("setType", "*/*");
        intent.Call<AndroidJavaObject>("addCategory", "android.intent.category.OPENABLE");
        currentActivity.Call("startActivityForResult", intent, 42);
    }

    // I want to return the selected file path here
    string filePath = ""; // How can I get the file path from the Intent's result?
    return filePath;
}

```

Trough that code i can successfully open the file browser on the device. But once i select a file, nothing happens—the result isn’t returned to Unity. I have no idea how to get the filepath from the intent. I have the required storage rights because I can query and load files with an direct path → e.g. _“/storage/emulated/0/Datasets/data.csv”_

Has anyone successfully implemented a working file picker on Magic Leap 2? What’s the best approach to retrieve the selected file path in Unity? Any help would be greatly appreciated!

---

<div class="post-metadata">

**Author:** ![etucker](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/etucker/32/842_2.png) [@etucker](https://forum.magicleap.cloud/u/etucker)\
**Post date:** [March 31, 2025, 5:00pm UTC](https://forum.magicleap.cloud/t/file-picker-on-magic-leap-2/5434/2 "2025-03-31T17:00:30Z")

</div>

I recommend taking a look at the following plugins. One allows you to pick a file using the system file picker. The other is a virtual file browser that can be edited to work on the Magic leap as well.

> **[GitHub - yasirkula/UnityNativeFilePicker: A native Unity plugin to import/export files...](https://github.com/yasirkula/UnityNativeFilePicker)**
>
> A native Unity plugin to import/export files from/to various document providers on Android & iOS

> **[GitHub - yasirkula/UnitySimpleFileBrowser: A uGUI based runtime file browser for Unity 3D...](https://github.com/yasirkula/UnitySimpleFileBrowser)**
>
> A uGUI based runtime file browser for Unity 3D (draggable and resizable)

---

<div class="post-metadata">

**Author:** ![alexander.gall](https://avatars.discourse-cdn.com/v4/letter/a/ed655f/32.png) [@alexander.gall](https://forum.magicleap.cloud/u/alexander.gall)\
**Post date:** [April 2, 2025, 6:35am UTC](https://forum.magicleap.cloud/t/file-picker-on-magic-leap-2/5434/3 "2025-04-02T06:35:44Z")

</div>

Many thanks for the answer and helpful links!!

I have already found the UnitySimpleFileBrowser and started to use it. Since this GUI is unfortunately more suitable for 2D applications, I am currently trying to change the code so that it can be accessed and interacted using the Magic Leap Controller.

The file browser already available on the device would be a great alternative here as it is already adapted to the system - unfortunately I have not yet had any success in getting the path after successfully clicking on a file.
