Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

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

form

Started by Michel V 8 years ago · 0 replies · 1118 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 Anna, 2 days ago
2 53 16 hours ago
Forms & Blueprints · by Anna, 3 days ago
7 82 16 hours ago
Forms & Blueprints · by Anna, 1 week ago
5 186 6 days ago
Forms & Blueprints · by TomW, 1 month ago
3 379 1 month ago
Forms & Blueprints · by Japhy, 2 months ago
2 595 2 months ago