Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

File Upload form - no file loaded

first-time

Solved by pamtbaau View solution

Started by John Edwards 4 years ago · 3 replies · 996 views
4 years ago

Running basic Quark theme on clean skeleton demo; hosted on apache
Added user/pages/02.upload; file form.md

YAML
title: Upload

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!

Appears to work fine, but no files loaded, have tried a few destinations. no errors in log. Loading small jpg file - validates ok in drag'n'drop box
There seem to be a few errors like this, but no clear resolution - some say 'fixed'

not modular - simple one page form. Note I have a contact form working fine
depending on when you look this may be available at www.jzedward.com/upload
tia - jzedward

4 years ago

brilliant! removed reset:true and changed from @self
that will teach me to cut'n'paste code I don't know...

4 years ago Solution

@jzedward, Did some debugging and created a new issue.

A better workaround would be to add upload: true to the process array. Removing 'reset' might cause some unwanted side effects in the UI after submitting the form.

YAML
process:
  upload: true
  reset: true
  message: Thanks!
👍 1
last edited 01/01/23 by pamtbaau

Suggested topics

Topic Participants Replies Views Activity
Support · by Anna, 4 days ago
1 93 4 days ago
Support · by Anna, 3 weeks ago
1 265 3 weeks ago
Support · by webmasterodp, 1 month ago
4 380 1 month ago
Support · by nwhitfield, 1 month ago
2 351 1 month ago
Support · by stell, 2 months ago
5 657 1 month ago