# Saving a JPG to a selected folder

**URL:** <https://forums.creativeclouddeveloper.com/t/saving-a-jpg-to-a-selected-folder/2838>\
**Category:** UXP Plugin API\
**Tags:** javascript\
**Created:** [April 20, 2021, 11:57am UTC](https://forums.creativeclouddeveloper.com/t/saving-a-jpg-to-a-selected-folder/2838 "2021-04-20T11:57:17Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![4t0m1c](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/4t0m1c/32/1330_2.png) [@4t0m1c](https://forums.creativeclouddeveloper.com/u/4t0m1c)\
**Post date:** [April 20, 2021, 5:57pm UTC](https://forums.creativeclouddeveloper.com/t/saving-a-jpg-to-a-selected-folder/2838/3 "2021-04-20T17:57:28Z")

</div>

Hi, thanks for replying 🙂 Images simply will not save out to a user-selected folder. What is the right way to approach this? UXP or batchplay?

My latest endeavour has been the following to no avail:

```
await userFolder.createFile(fileName + ".jpg").then(async result => {
            console.log("*** Path: " + result.nativePath);
            await fs.createSessionToken(result).then(async token => {
                document.save(token);
            });
    });

```

and:

```
await fs.getFileForSaving(fileName + ".jpg").then(async entry => {
    console.log("*** Path: " + result.nativePath);
    await fs.createSessionToken(entry).then(async token => {
        document.save(token);
    });
});
```

---

_[View the full topic](https://forums.creativeclouddeveloper.com/t/saving-a-jpg-to-a-selected-folder/2838)._
