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

How to get path from an uploaded file

Started by Muut Archive 10 years ago · 2 replies · 794 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 1359 9 years ago
Archive · by Muut Archive, 9 years ago
2 936 9 years ago
Archive · by Muut Archive, 9 years ago
2 4066 9 years ago
Archive · by Muut Archive, 9 years ago
1 2955 9 years ago
Archive · by Muut Archive, 9 years ago
3 1121 9 years ago