# Upload files onto targets

**URL:** <https://forum.legato.io/t/upload-files-onto-targets/6226>\
**Category:** Uncategorized\
**Created:** [June 13, 2022, 8:01am UTC](https://forum.legato.io/t/upload-files-onto-targets/6226 "2022-06-13T08:01:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Reinhard](https://avatars.discourse-cdn.com/v4/letter/r/a9adbd/32.png) [@Reinhard](https://forum.legato.io/u/Reinhard)\
**Post date:** [June 13, 2022, 8:01am UTC](https://forum.legato.io/t/upload-files-onto-targets/6226/1 "2022-06-13T08:01:12Z")

</div>

Hey!

I need to upload a file (e.g. config.xml) onto my target, multiple apps inside a system need to be able to access this file. Is there a proper way to upload this file using the .sdef file?

I want to upload the file to /opt/config.xml.

I tried using “bundle” but that doesn’t seem to work.  
Is something like that possible?

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [June 13, 2022, 8:13am UTC](https://forum.legato.io/t/upload-files-onto-targets/6226/2 "2022-06-13T08:13:43Z")

</div>

/opt is read-only folder.  
You need to type the following in each boot up to make it writable:

```auto

mkdir /tmp/tmp_opt
mkdir /tmp/tmp_opt_wr
mount -t overlay overlay /opt -o lowerdir=/opt,upperdir=/tmp/tmp_opt,workdir=/tmp/tmp_opt_wr;
root@swi-mdm9x28-wp:~# echo 123 > /opt/123.txt
root@swi-mdm9x28-wp:~# cat /opt/123.txt
123

```

you can first save your config.xml in /home/root  
and then copy to /opt folder in each power on.

---

<div class="post-metadata">

**Author:** ![Reinhard](https://avatars.discourse-cdn.com/v4/letter/r/a9adbd/32.png) [@Reinhard](https://forum.legato.io/u/Reinhard)\
**Post date:** [June 13, 2022, 8:28am UTC](https://forum.legato.io/t/upload-files-onto-targets/6226/3 "2022-06-13T08:28:05Z")

</div>

Hey jyijyi,

/home/root would also be a feasable alternative to /opt, so the read-only isn’t an issue.

I would like to somehow add my files to the system so i only need to execute “update mySystem.wp76xx.update” and my needed files are automatically uploaded to /home/root.

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [June 13, 2022, 8:29am UTC](https://forum.legato.io/t/upload-files-onto-targets/6226/4 "2022-06-13T08:29:24Z")

</div>

you can write a unsandboxed application to copy your bundled file to /home/root  
you can also see here on how to modify the file outside the sandbox:

> [@Opening Files in Sandboxed App](https://forum.legato.io/t/opening-files-in-sandboxed-app/5525):
>
> Quick question: I created a file in /tmp on my WP8548: /tmp/test.txt How do i access it in my Sandboxed app? I tried adding requires: { file: { /tmp/test.txt /tmp } } But i still cannot open it.

---

<div class="post-metadata">

**Author:** ![Reinhard](https://avatars.discourse-cdn.com/v4/letter/r/a9adbd/32.png) [@Reinhard](https://forum.legato.io/u/Reinhard)\
**Post date:** [June 13, 2022, 8:34am UTC](https://forum.legato.io/t/upload-files-onto-targets/6226/5 "2022-06-13T08:34:47Z")

</div>

Is there really no other way to do this using sandboxed apps?  
I want to keep my Apps Sandboxed and just grant read/write permissions on the specific files needed.

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [June 13, 2022, 8:38am UTC](https://forum.legato.io/t/upload-files-onto-targets/6226/6 "2022-06-13T08:38:21Z")

</div>

how about creating a dynamic link in /home/root to point to this bundled file in your sandboxed application directory?
