# Uploading files from scripts is not allowed

**URL:** <https://community.postman.com/t/uploading-files-from-scripts-is-not-allowed/7885>\
**Category:** Help Hub\
**Created:** [September 19, 2019, 8:59am UTC](https://community.postman.com/t/uploading-files-from-scripts-is-not-allowed/7885 "2019-09-19T08:59:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![batuarslan](https://avatars.discourse-cdn.com/v4/letter/b/b2d939/32.png) [@batuarslan](https://community.postman.com/u/batuarslan)\
**Post date:** [September 19, 2019, 8:59am UTC](https://community.postman.com/t/uploading-files-from-scripts-is-not-allowed/7885/1 "2019-09-19T08:59:42Z")

</div>

I have a request like:

```
pm.sendRequest({
        url: pm.environment.get("mainUrl") + "/" + pm.environment.get("blackList") + "?name=" + name,
        method: 'POST',
        header: {
            'content-type': 'text/csv',
            'Authorization': "Bearer " + pm.environment.get("accessToken"),
            'Accept': "*/*"
        },
        body: {
            mode: 'formdata',
            formdata: [{
                "key": "file",
                "type": "file",
                "src": "resources/" + file
            }]
        }
    }

```

However, I’m getting this error:

` Uploading files from scripts is not allowed`

I need to upload scripts from pre-request since we are making every test independent of each other. Is there any way to achieve this?

---

<div class="post-metadata">

**Author:** ![rocio.garcia](https://avatars.discourse-cdn.com/v4/letter/r/e0b2c6/32.png) [@rocio.garcia](https://community.postman.com/u/rocio.garcia)\
**Post date:** [September 18, 2020, 3:02pm UTC](https://community.postman.com/t/uploading-files-from-scripts-is-not-allowed/7885/2 "2020-09-18T15:02:33Z")

</div>

you solved the problem??? @vdespa Can you help us with this?

---

<div class="post-metadata">

**Author:** ![vdespa](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/vdespa/32/2770_2.png) [@vdespa](https://community.postman.com/u/vdespa)\
**Post date:** [September 19, 2020, 9:16am UTC](https://community.postman.com/t/uploading-files-from-scripts-is-not-allowed/7885/3 "2020-09-19T09:16:52Z")

</div>

The error kinda says everything:

`Uploading files from scripts is not allowed`

Use a regular Postman request for this use-case.
