Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
pamtbaau opened this issue Jan 1, 2023 · 0 comments
Open

Comments

@pamtbaau
Copy link

pamtbaau commented Jan 1, 2023

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:

  • Add action 'upload' in form definition. Like:
    process:
      upload: true 
      reset: true
      message: Thanks!
    
  • Remove action 'reset', but this may have unwanted side effects.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant