getgrav / grav-plugin-form

Grav Form Plugin
http://getgrav.org
MIT License
53 stars 79 forks source link

Revisit: Field 'file' does not save file when used in front-end form #588

Open pamtbaau opened 1 year ago

pamtbaau commented 1 year ago

This issue has been mentioned before, but hasn't been addressed properly so far.

Note: This issue only occurs in front-end forms, not when used in blueprints.

The following form does not save the file:

form:
    name: upload
    fields:
      myfile:
        type: file
        label: Uploads
        destination: 'user/data/upload'
        multiple: true
        autofocus: false
        accept:
          - image/* 
    buttons:
      - type: submit
        value: Submit
    process:
      reset: true
      message: Thanks!

In this case, action 'reset' is performed before action 'upload'. Since 'reset' clears the flash containing the upload info, there is nothing to save anymore...

Workarounds until issue has been fixed: