Deleting files from panel


i deleted files in the panel, but they dont get deleted on the server.
i have this in the blueprint:

                    label: My Files

in the template i get the files like this:

 $pdfs = $uebung->documents()->filterBy('extension', 'pdf');
                    if ($pdfs->isNotEmpty()) : ?>
                         <?php foreach($pdfs as $pdf): ?>
                                   <div class="pdf">[PDF] <a href="<?= $pdf->url() ?>" target="_blank">                   
                                    <?= $pdffilename ?>    
                         <?php endforeach ?>
                    <?php endif ?>

since i dont want to put them manually into the textarea.
i need them to be really deleted from server, because else they still show up even if i delete them from the panel.

any hint appreciated!


What is files in your example above? A files field or a section. If it is a files section, then the file is just removed from the selected files. If it is a files section, the file should be deleted from the server.

If it is a files field, what is its purpose, if you are not using the selection in your template?

hello texnixe,


its a field and i thought the code above would access the info stored in this field. but it seems it accesses the directory. so yes i can see then the files field is useless.
would be ok for me, but i plan to have other users who cant upload files via ftp client and just need a simple upload and delete functionality. so do i understand correctly i would need a files section then for which i would need to code a plugin like here? Sections | Kirby CMS
My first Panel section | Kirby CMS


No, you do just need to replace the files field with a files section: Files section | Kirby CMS