Skip to content

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

Open

Description

@pamtbaau

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions