# How to store file with : / ? in its name?

**URL:** <https://forum.solidproject.org/t/how-to-store-file-with-in-its-name/1816>\
**Category:** Solid App Development FAQs\
**Created:** [May 10, 2019, 3:32am UTC](https://forum.solidproject.org/t/how-to-store-file-with-in-its-name/1816 "2019-05-10T03:32:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![linonetwo](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/linonetwo/32/4039_2.png) [@linonetwo](https://forum.solidproject.org/u/linonetwo)\
**Post date:** [May 10, 2019, 3:32am UTC](https://forum.solidproject.org/t/how-to-store-file-with-in-its-name/1816/1 "2019-05-10T03:32:35Z")

</div>

I tried to POST a file with `slug: %24%3A%2FStoryList` which is from `encodeURIComponent()`, but Response is `The name of new file POSTed may not contain : | or /`

When I `encodeURIComponent` it twice, then POST with `slug: %2524%253A%252FStoryList`, it Response with `PUT not supported on containers, use POST instead`

So what is the proper way to escape illegal characters in the filename?

---

<div class="post-metadata">

**Author:** ![linonetwo](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/linonetwo/32/4039_2.png) [@linonetwo](https://forum.solidproject.org/u/linonetwo)\
**Post date:** [May 10, 2019, 3:49am UTC](https://forum.solidproject.org/t/how-to-store-file-with-in-its-name/1816/2 "2019-05-10T03:49:17Z")

</div>

Is this related with [Error saving back: Error: Web error: 409 (Conflict) on PUT](http://forum.solidproject.org/t/error-saving-back-error-web-error-409-conflict-on-put/1011)

---

<div class="post-metadata">

**Author:** ![linonetwo](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/linonetwo/32/4039_2.png) [@linonetwo](https://forum.solidproject.org/u/linonetwo)\
**Post date:** [May 10, 2019, 4:39am UTC](https://forum.solidproject.org/t/how-to-store-file-with-in-its-name/1816/3 "2019-05-10T04:39:08Z")

</div>

> [@linonetwo](#):
>
> PUT not supported on containers, use POST instead

I know why, POST in the NSS just call PUT to do the actual job:

> <https://github.com/nodeSolidServer/node-solid-server/blob/51cd35c045eb7dfc85e369cf45258df9a4bafb08/lib/ldp.js#L165-L207>

```auto
async post (host, containerPath, stream, { container, slug, extension }) {
    await ldp.put(putUrl, stream, contentType)
}
...
async put (url, stream, contentType) {
    // PUT requests not supported on containers. Use POST instead
    if ((url.url || url).endsWith('/')) {
...
}

```

And PUT check whether slug ends with `/`

And this `/` is added here:

> <https://github.com/nodeSolidServer/node-solid-server/blob/51cd35c045eb7dfc85e369cf45258df9a4bafb08/lib/ldp.js#L149-L153>
