Deleting files when deselected

Hi,

I have a files section in my blueprint where users can upload images and can select a maximum of 3 images.

When an image is deselected I would love to get it deleted.
Is that possible?

Template:

extraImages:
  label: "Alle afbeeldingen"
  type: files
  layout: cards
  size: tiny
  template: cover
  max: 3
  image:
    cover: true
    back: white
    accept: image/jpeg

That looks like a files field, not a files section. Otherwise you wouldn’t be able to select files.

Note that for a files field to assign a template, you have to use the upload option not the template option.

The only thing you can do to automatically delete a deselected file is use a page.update:after hook.

Ah, the template part was an error.
Removed it now, thanks.

I’m going to try page.update:after hook. :+1:

I’ve got it working.
Thanks @texnixe !