# Save files to folder

**URL:** <https://forum.getkirby.com/t/save-files-to-folder/23415>\
**Category:** Questions\
**Tags:** v3\
**Created:** [September 14, 2021, 9:29am UTC](https://forum.getkirby.com/t/save-files-to-folder/23415 "2021-09-14T09:29:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mantas\_G](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/mantas_g/32/10787_2.png) [@Mantas\_G](https://forum.getkirby.com/u/Mantas_G)\
**Post date:** [September 14, 2021, 9:29am UTC](https://forum.getkirby.com/t/save-files-to-folder/23415/1 "2021-09-14T09:29:44Z")

</div>

I’m trying to make kirby save files custom folder: /content/client\_files.

1. I created blueprint "/site/blueprint/files/client\_file.yml

```auto
title: Image

accept:
  mime: .csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel

fields:
  alt:
    label: Alt Text
    type: text
    width: 1/2
    required: true
  caption:
    label: Caption
    type: textarea

```

1. I created blueprint “/site/blueprint/pages/client\_files.yml” - it will be parent.

```auto
title: Client files
# preset: page

```

1. I created templates “client\_file.php” and “client\_files.php” in /site/templates/ directory (I’m not sure, if they are required).
2. I created folder /content/client\_files
3. I created file /content/client\_files/client\_files.txt
4. I created blueprint tab in site.yml:

```auto
tabs:
<...>
  files:
    label: Client files
    fields:
      client_file:
        type: files
        label: Downloads
        multiple: true
        translate: false
        uploads:
          parent: client_files
          template: client_file

```

When I try to upload file, I get error that file can not be created on null. If I comment #parent: client\_files, then the file is uploaded to /content. What I’m missing? I can not find documentation, how could I do this in the correct way.

---

<div class="post-metadata">

**Author:** ![pixelijn](https://avatars.discourse-cdn.com/v4/letter/p/7ab992/32.png) [@pixelijn](https://forum.getkirby.com/u/pixelijn)\
**Post date:** [September 14, 2021, 10:03am UTC](https://forum.getkirby.com/t/save-files-to-folder/23415/2 "2021-09-14T10:03:15Z")

</div>

> [@Mantas\_G](#):
>
> ` parent: client_files`

You have to provide a page object as parent:

```auto
parent: kirby.page('client_files')

```

---

<div class="post-metadata">

**Author:** ![Mantas\_G](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/mantas_g/32/10787_2.png) [@Mantas\_G](https://forum.getkirby.com/u/Mantas_G)\
**Post date:** [September 14, 2021, 10:13am UTC](https://forum.getkirby.com/t/save-files-to-folder/23415/3 "2021-09-14T10:13:42Z")

</div>

> [@pixelijn](#):
>
> `kirby.page('client_files')`

Thank you, it works.

But when file is deleted from panel - it is not deleted in content folder. Is this by design, or should I turn on some option for deleting it from content too?

---

<div class="post-metadata">

**Author:** ![pixelijn](https://avatars.discourse-cdn.com/v4/letter/p/7ab992/32.png) [@pixelijn](https://forum.getkirby.com/u/pixelijn)\
**Post date:** [September 14, 2021, 10:17am UTC](https://forum.getkirby.com/t/save-files-to-folder/23415/4 "2021-09-14T10:17:39Z")

</div>

> [@Mantas\_G](#):
>
> But when file is deleted from panel - it is not deleted in content folder.

You are using a files field and therefore when you remove the file from the field, it is only removed from the field value in the content folder. You would have to go to the file view to actually delete the file.

If you don’t want to explicitely select a file out of a set (which is the purpose of the files field), consider using a files section instead.

---

<div class="post-metadata">

**Author:** ![Mantas\_G](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/mantas_g/32/10787_2.png) [@Mantas\_G](https://forum.getkirby.com/u/Mantas_G)\
**Post date:** [September 14, 2021, 2:19pm UTC](https://forum.getkirby.com/t/save-files-to-folder/23415/5 "2021-09-14T14:19:39Z")

</div>

thank you
