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.

Archive

Create a file upload in Configuration/Site

Started by Muut Archive 9 years ago · 1 replies · 453 views
9 years ago

Hi. I'm wondering where to paste this snippet that a file upload dialog appears?

I want to have the file upload field in Config/Site, put it in user/config/site.yaml but it didn't work... The upload doesn't appear.

9 years ago

This worked. Thanks to @paul_massendari in the slack channel.

user/blueprints/config/site.yaml

--- yaml
@extends:
'@parent'

form:
fields:
content:

YAML
        fields:
            my_files:
              type: file
              label: My Files
              multiple: true
              destination: 'user/download'
              random_name: false
              avoid_overwriting: false
              limit:
              filesize: 7 
              accept:
                - application/pdf

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1296 9 years ago
Archive · by Muut Archive, 9 years ago
2 890 9 years ago
Archive · by Muut Archive, 9 years ago
2 4019 9 years ago
Archive · by Muut Archive, 9 years ago
1 2894 9 years ago
Archive · by Muut Archive, 9 years ago
3 1078 9 years ago