# UXP plugin Upload active document using xhr to presigned URL

**URL:** <https://forums.creativeclouddeveloper.com/t/uxp-plugin-upload-active-document-using-xhr-to-presigned-url/4347>\
**Category:** UXP Plugin API\
**Created:** [February 24, 2022, 5:52pm UTC](https://forums.creativeclouddeveloper.com/t/uxp-plugin-upload-active-document-using-xhr-to-presigned-url/4347 "2022-02-24T17:52:21Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![AOK](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/aok/32/2360_2.png) [@AOK](https://forums.creativeclouddeveloper.com/u/AOK)\
**Post date:** [February 24, 2022, 10:11pm UTC](https://forums.creativeclouddeveloper.com/t/uxp-plugin-upload-active-document-using-xhr-to-presigned-url/4347/5 "2022-02-24T22:11:54Z")

</div>

I’ve tried using let fileEntry = require(‘uxp’).storage.localFileSystem.getFileForOpening(), but get the Error: Plugin is not permitted to access the file picker.

I also tried using the method you suggested from this post [Saving a JPG to a selected folder - #3 by 4t0m1c](http://forums.creativeclouddeveloper.com/t/saving-a-jpg-to-a-selected-folder/2838/3)  
I found I had to use executeAsModal but still can’t get it to save to a temporary folder.

```auto
const lfs = uxp.storage.localFileSystem;
const tempFolder = await lfs.getTemporaryFolder();
const saveFileToFolder = async (tempFolder, fileName="temp") => {
          const file = await tempFolder.createFile(`${fileName}.jpg`);
          const activeDocument = require("photoshop").app.activeDocument;
          return activeDocument.save(file);
      }
        
        await require('photoshop').core.executeAsModal(saveFileToFolder);

```

It errors saying the createFile is not a function.

I just need a way to attach the active document’s file object to the fetch or xhr upload.

---

_[View the full topic](https://forums.creativeclouddeveloper.com/t/uxp-plugin-upload-active-document-using-xhr-to-presigned-url/4347)._
