Maxsize attribute isnt working

Hi,

I am trying to set a upload limit for the files I upload in the panel. However, it seems to not be working. Not sure if there is something wrong I am doing here.

Here is the code:

site/blueprints/files/image.yml

title: Image
accept:
  type: image
  maxsize: 500

site/blueprints/pages/test.yml

title: Test
columns:
  - width: 3/3
    fields:
      rhs_banner_images:
        type: files
        layout: cards
        template: image
        info: "{{ file.niceSize }} - {{ file.dimensions }} <br> {{ file.modified('d-m-Y h:i A') }}"
        image:
          ratio: 5/4
        min: 1
        size: small

      lhs_banner_images:
        type: files
        layout: cards
        template: image
        accept:
          type: image
          maxsize: 500
        info: "{{ file.niceSize }} - {{ file.dimensions }} <br> {{ file.modified('d-m-Y h:i A') }}"
        image:
          ratio: 5/4

I was referring to : File blueprint | Kirby CMS

However, I was still able to upload 2 big pics in both the sections.

Let me know what I am doing wrong or if there is another approach.

Fields don’t have a template property, should be uploads: image, or

uploads:
  template: image

Got it…thanks!

Also i was wondering, can i do it in a single yml? This also seems to not be working:

title: Test
columns:
  - width: 3/3
    fields:
      rhs_banner_images:
        type: files
        uploads:
          accept:
            type: image
            maxsize: 500

No, you cannot do it there, needs to be in the file blueprint. See documentation to what properties are available for what.

1 Like