Skip to content
Grav 2.1 is out: every page speaks Markdown. Read the announcement →

How to get path from an uploaded file

Started by Muut Archive 10 years ago · 2 replies · 872 views
10 years ago

Hello,

I have created a file upload section in user/blueprints/config/site.yaml as follows:

YAML
form:
  fields:
    content:
      fields:
        logo:
          type: file
          label: Logo
          destination: 'theme@:/images'
          filesize: 5
          accept:
          - image/*

In the user/config/site.yaml file the uploaded file details are stored as follows

YAML
logo:
  user/themes/mytheme/images/logo.png: 
    name: logo.png
    type: image/png
    size: 11045
    path: user/themes/mytheme/images/logo.png

I've scoured the docs and forums but i cant figure out the twig syntax to retrieve the uploaded file's path.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 2289 9 years ago
Archive · by Muut Archive, 9 years ago
2 1504 9 years ago
Archive · by Muut Archive, 9 years ago
2 4754 9 years ago
Archive · by Muut Archive, 9 years ago
1 3570 9 years ago
Archive · by Muut Archive, 9 years ago
3 1627 9 years ago