Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

How to access file uploaded via form/File in a list

form

Started by Michel V 8 years ago · 0 replies · 987 views
8 years ago

New user.

I am building a custom page with a download link to a file that was uploaded using the File upload with a list.

part of the code in page.yaml
header.files:
name: versions
type: list
label: files and versions
fields:
.fileversion:
type: text
.external
type: text
.versionfile
type: file
name: versionfile
label: Version File
multiple: false
destination: 'assets'
accept:

  • .pdf

Uploading here works fine

But: how do I get access to this data in the twig file?
I want to achieve something like:

<a href=/assets/VERSIONFILE.pdf>VERSIONFILE</a>

I have read the very good documentation how to build the form, but it does not mention anything about how to access the data after the form has been submitted. The only example is on an image, but a PDF clearly is not image.

Any suggestion, or link to a clear example?

tia
Michel

Suggested topics

Topic Participants Replies Views Activity
Forms & Blueprints · by Japhy, 2 weeks ago
2 270 4 days ago
Forms & Blueprints · by FrViPofm, 4 weeks ago
5 329 4 weeks ago
Forms & Blueprints · by Ton Haarmans, 6 years ago
13 2319 8 months ago
Forms & Blueprints · by Hugo Oliveira, 9 months ago
0 781 9 months ago
Forms & Blueprints · by Flachy Joe, 10 months ago
9 871 10 months ago