# Saving and Accessing Files on Magic Leap

**URL:** <https://forum.magicleap.cloud/t/saving-and-accessing-files-on-magic-leap/3765>\
**Category:** Unity Development\
**Created:** [July 11, 2024, 11:55am UTC](https://forum.magicleap.cloud/t/saving-and-accessing-files-on-magic-leap/3765 "2024-07-11T11:55:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zul01](https://avatars.discourse-cdn.com/v4/letter/z/4da419/32.png) [@Zul01](https://forum.magicleap.cloud/u/Zul01)\
**Post date:** [July 11, 2024, 11:55am UTC](https://forum.magicleap.cloud/t/saving-and-accessing-files-on-magic-leap/3765/1 "2024-07-11T11:55:09Z")

</div>

Hi,

I am trying to capture a frame from magic leap and save it as JPG on the device. I am saving it in the following manner:

```
    yield return new WaitForSeconds(2f);

    debugText.SetText("Capturing a Frame");

    // Capture a frame
    Task<Texture2D> task = imageAcquirer.GetImage();
    yield return new WaitUntil(() => task.IsCompleted);

    Texture2D frame = task.Result;
    if (frame != null)
    {
        debugText.SetText("Saving as JPG");

        byte[] bytes = frame.EncodeToJPG();
        string filePath = Application.persistentDataPath + "/ML2currentFrame.jpg";
        File.WriteAllBytes(filePath, bytes);

        debugText.SetText("Saved JPG to " + filePath);

```

The path it is stored into is : /storage/emulated/0/Android/data/com.base64\_NoJson.base64\_NoJson/files/ML2currentFrame.jpg .. however I cannot find any files in that location.

 ![image](https://us1.discourse-cdn.com/flex019/uploads/magicleap1/original/2X/4/427b4f8046b410212603ce6969078e43eda7a27f.png)

I believe the file is saved in that location as I was able to access the JPG from the same path and visualize the texture on a raw image.

Can you point me towards how I can access the files being stored locally on the device? Thanks.

---

<div class="post-metadata">

**Author:** ![kbabilinski](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/kbabilinski/32/19_2.png) [@kbabilinski](https://forum.magicleap.cloud/u/kbabilinski)\
**Post date:** [July 11, 2024, 5:14pm UTC](https://forum.magicleap.cloud/t/saving-and-accessing-files-on-magic-leap/3765/2 "2024-07-11T17:14:25Z")

</div>

I think this is because you are looking in the wrong directory try `/sdcard/Android/data/com.base64_NoJson.base64_NoJson/files/...` instead.

 ![image](https://us1.discourse-cdn.com/flex019/uploads/magicleap1/original/2X/6/6a1b2a35f3672e98ceb112969cbe0cc4d0164a7d.png)

---

<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:** [July 26, 2024, 8:28pm UTC](https://forum.magicleap.cloud/t/saving-and-accessing-files-on-magic-leap/3765/3 "2024-07-26T20:28:39Z")

</div>


