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

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

form

Started by Michel V 8 years ago · 0 replies · 885 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, 6 years ago
13 2071 7 months ago
Forms & Blueprints · by Hugo Oliveira, 8 months ago
0 574 8 months ago
Forms & Blueprints · by Flachy Joe, 9 months ago
9 664 9 months ago
Forms & Blueprints · by Augustus, 9 months ago
7 715 9 months ago
Forms & Blueprints · by Julien, 10 months ago
10 700 10 months ago