Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Support

File Upload form - no file loaded

first-time

Solved by pamtbaau View solution

Started by John Edwards 3 years ago · 3 replies · 477 views
3 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

3 years ago

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

3 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 Thomas, 1 week ago
2 55 13 hours ago
Support · by Anna, 3 days ago
2 60 15 hours ago
Support · by Justin Young, 16 hours ago
1 31 16 hours ago
Support · by Duc , 1 week ago
2 65 5 days ago
Support · by Colin Hume, 1 week ago
2 58 5 days ago