# Deleting files from the panel and also from directories

**URL:** <https://forum.getkirby.com/t/deleting-files-from-the-panel-and-also-from-directories/24859>\
**Category:** Questions\
**Tags:** v3\
**Created:** [March 1, 2022, 9:58am UTC](https://forum.getkirby.com/t/deleting-files-from-the-panel-and-also-from-directories/24859 "2022-03-01T09:58:38Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![SimTheGeek](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/simthegeek/32/9381_2.png) [@SimTheGeek](https://forum.getkirby.com/u/SimTheGeek)\
**Post date:** [March 1, 2022, 9:58am UTC](https://forum.getkirby.com/t/deleting-files-from-the-panel-and-also-from-directories/24859/1 "2022-03-01T09:58:38Z")

</div>

Good morning all,  
Hope you’re fine ?  
Is it possible to authorize the deletion of files present directly in the directories ?  
The delete button only hide files from the Panel but the files still exist in directories…  
Thank you !

 ![2022-03-01_Screenshot](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/9/9e0496d2d7658b25b442874416629e275db43260.png)

---

<div class="post-metadata">

**Author:** ![stffr](https://avatars.discourse-cdn.com/v4/letter/s/c89c15/32.png) [@stffr](https://forum.getkirby.com/u/stffr)\
**Post date:** [March 1, 2022, 10:11am UTC](https://forum.getkirby.com/t/deleting-files-from-the-panel-and-also-from-directories/24859/2 "2022-03-01T10:11:47Z")

</div>

You are using a files field, right? Then you are just removing the file entries from that field. It does not affect the files from the page.

> **[Files](https://getkirby.com/docs/reference/panel/fields/files)**
>
> A files select field that allows to select one or multiple related files

You probably want to use a file section ([Files section | Kirby CMS](https://getkirby.com/docs/reference/panel/sections/files)) with templating to structure your files per page. Then you can delete them right in the section.

---

<div class="post-metadata">

**Author:** ![SimTheGeek](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/simthegeek/32/9381_2.png) [@SimTheGeek](https://forum.getkirby.com/u/SimTheGeek)\
**Post date:** [March 1, 2022, 10:39am UTC](https://forum.getkirby.com/t/deleting-files-from-the-panel-and-also-from-directories/24859/3 "2022-03-01T10:39:57Z")

</div>

Yes, here is my code sample :

```auto
title: Demande
icon: page

tabs:
	demandes:
		label: Votre demande
		icon: text
		fields:
			author:
				label: Contact
				type: users
				disabled: true
				width: 2/3
			event_type:
				label: Asking for
				type: select
				width: 1/3
				options:
					- Event
					- Meeting
					- Conference
			healineTwo:
				label: Fichiers/documents obligatoires
				type: headline

			# Event files
			file_event_presentation:
				type: files
				label: Event presentation
				template: event_presentation
				width: 2/4
				when:
					event_type: Event
			file_event_program:
				type: files
				label: Event program
				template: event_program
				width: 2/4
				when:
					event_type: Event
			file_event_budget:
				type: files
				label: Event budget
				template: event_budget
				width: 2/4
				when:
					event_type: Event

			# Meeting files
			file_meeting_presentation:
				type: files
				label: Meeting (presentation)
				template: meeting_presentation
				width: 2/4
				when:
					event_type: Meeting

```

---

<div class="post-metadata">

**Author:** ![SimTheGeek](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/simthegeek/32/9381_2.png) [@SimTheGeek](https://forum.getkirby.com/u/SimTheGeek)\
**Post date:** [March 1, 2022, 11:27am UTC](https://forum.getkirby.com/t/deleting-files-from-the-panel-and-also-from-directories/24859/4 "2022-03-01T11:27:52Z")

</div>

If I understood correctly, it is mandatory to use a “section”?  
I have an error when I put sections in tabs ☹

---

<div class="post-metadata">

**Author:** ![stffr](https://avatars.discourse-cdn.com/v4/letter/s/c89c15/32.png) [@stffr](https://forum.getkirby.com/u/stffr)\
**Post date:** [March 1, 2022, 1:29pm UTC](https://forum.getkirby.com/t/deleting-files-from-the-panel-and-also-from-directories/24859/5 "2022-03-01T13:29:49Z")

</div>

It’s mandatory, if you want to be able to delete files directly, I guess.

What error are you getting?

---

<div class="post-metadata">

**Author:** ![SimTheGeek](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/simthegeek/32/9381_2.png) [@SimTheGeek](https://forum.getkirby.com/u/SimTheGeek)\
**Post date:** [March 1, 2022, 1:56pm UTC](https://forum.getkirby.com/t/deleting-files-from-the-panel-and-also-from-directories/24859/6 "2022-03-01T13:56:28Z")

</div>

Thank you @stffr

Here is the error :

![image](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/6/68efec241e61f953a62378b6e1cb7db7352079e1.png)

---

<div class="post-metadata">

**Author:** ![SimTheGeek](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/simthegeek/32/9381_2.png) [@SimTheGeek](https://forum.getkirby.com/u/SimTheGeek)\
**Post date:** [March 1, 2022, 2:09pm UTC](https://forum.getkirby.com/t/deleting-files-from-the-panel-and-also-from-directories/24859/7 "2022-03-01T14:09:11Z")

</div>

Mabye sections need to be placed before fields…

---

<div class="post-metadata">

**Author:** ![SimTheGeek](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/simthegeek/32/9381_2.png) [@SimTheGeek](https://forum.getkirby.com/u/SimTheGeek)\
**Post date:** [March 1, 2022, 2:23pm UTC](https://forum.getkirby.com/t/deleting-files-from-the-panel-and-also-from-directories/24859/8 "2022-03-01T14:23:05Z")

</div>

Yeahh was that !!  
Files deletion works well now 🤩 !!!

Now have to mix with conditional sections !
