# How I Save a Module to File？

**URL:** <https://tech-community.robotics.abb.com/t/how-i-save-a-module-to-file/14976>\
**Category:** AppStudio\
**Created:** [May 10, 2026, 11:37am UTC](https://tech-community.robotics.abb.com/t/how-i-save-a-module-to-file/14976 "2026-05-10T11:37:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![liang\_changhong](https://avatars.discourse-cdn.com/v4/letter/l/3bc359/32.png) [@liang\_changhong](https://tech-community.robotics.abb.com/u/liang_changhong)\
**Post date:** [May 10, 2026, 11:37am UTC](https://tech-community.robotics.abb.com/t/how-i-save-a-module-to-file/14976/1 "2026-05-10T11:37:45Z")

</div>

I want save a Module to file，How can I do？

const module = await RWS.Rapid.getModule(‘T\_ROB1’, ‘TestModule’);

Next ？

---

<div class="post-metadata">

**Author:** ![liao\_Chen](https://avatars.discourse-cdn.com/v4/letter/l/f0a364/32.png) [@liao\_Chen](https://tech-community.robotics.abb.com/u/liao_Chen)\
**Post date:** [May 11, 2026, 7:52am UTC](https://tech-community.robotics.abb.com/t/how-i-save-a-module-to-file/14976/2 "2026-05-11T07:52:55Z")

</div>

which position you want to save? in the $HOME? or to PC?

---

<div class="post-metadata">

**Author:** ![liang\_changhong](https://avatars.discourse-cdn.com/v4/letter/l/3bc359/32.png) [@liang\_changhong](https://tech-community.robotics.abb.com/u/liang_changhong)\
**Post date:** [May 12, 2026, 2:23am UTC](https://tech-community.robotics.abb.com/t/how-i-save-a-module-to-file/14976/3 "2026-05-12T02:23:52Z")

</div>

$HOME/Data, thank you! the old sdk have function ‘Saves the RAPID module to the specified file path’ SaveToFile(string filePath), I want complete same function

---

<div class="post-metadata">

**Author:** ![liao\_Chen](https://avatars.discourse-cdn.com/v4/letter/l/f0a364/32.png) [@liao\_Chen](https://tech-community.robotics.abb.com/u/liao_Chen)\
**Post date:** [May 12, 2026, 2:50am UTC](https://tech-community.robotics.abb.com/t/how-i-save-a-module-to-file/14976/4 "2026-05-12T02:50:48Z")

</div>

const test3 = async (moduleName) =\> {

```
const Url = '/rw/rapid/tasks/T_ROB1/modules/' + moduleName + '/save';

const valueStr = 'name=' + moduleName + '&path=$HOME/data';

await RWS.Network.post(Url, valueStr);

```

}

export default test3;

---

<div class="post-metadata">

**Author:** ![liao\_Chen](https://avatars.discourse-cdn.com/v4/letter/l/f0a364/32.png) [@liao\_Chen](https://tech-community.robotics.abb.com/u/liao_Chen)\
**Post date:** [May 12, 2026, 2:53am UTC](https://tech-community.robotics.abb.com/t/how-i-save-a-module-to-file/14976/5 "2026-05-12T02:53:04Z")

</div>

use this in the button onClick event: await UserFunction.test3(‘m2’);// ‘m2’ is the module name

---

<div class="post-metadata">

**Author:** ![liang\_changhong](https://avatars.discourse-cdn.com/v4/letter/l/3bc359/32.png) [@liang\_changhong](https://tech-community.robotics.abb.com/u/liang_changhong)\
**Post date:** [May 13, 2026, 5:01am UTC](https://tech-community.robotics.abb.com/t/how-i-save-a-module-to-file/14976/6 "2026-05-13T05:01:33Z")

</div>

thank you! the function work perfect!
