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.

Forms & Blueprints

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

form

Started by Michel V 8 years ago · 0 replies · 691 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 Ton Haarmans, 5 years ago
13 1140 4 months ago
Forms & Blueprints · by Hugo Oliveira, 5 months ago
0 63 5 months ago
Forms & Blueprints · by Flachy Joe, 6 months ago
9 138 6 months ago
Forms & Blueprints · by Augustus, 7 months ago
7 114 7 months ago
Forms & Blueprints · by Julien, 7 months ago
10 132 7 months ago