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

File Upload form - no file loaded

first-time

Solved by pamtbaau View solution

Started by John Edwards 4 years ago · 3 replies · 556 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 BenLaKnet, 5 days ago
1 120 2 days ago
Support · by BenLaKnet, 1 week ago
5 194 2 days ago
Support · by kskt, 2 days ago
0 44 2 days ago
Support · by David Meissner, 3 days ago
0 43 3 days ago
Support · by David Meissner, 3 days ago
3 92 3 days ago