Modifier: :download
Force-download link. Write it after a colon: {Field:1:download}
About
Emits a download URL that sends the file as an attachment rather than opening it.
| Product | Gravity Forms |
|---|---|
| Requires | Gravity Forms 2.5 or later |
| Works on | File upload, Post image fields |
| In the picker | Other settings |
How to use it
Link straight to the file
The link downloads the file instead of opening it in the browser.
Write
<a href="{Attachment:18:download}">Download the invoice</a>Get
<a href="http://fixture.gravitykit.test/index.php?gf-download=fixture-invoice.pdf&form-id=501&field-id=18&entry-id=5001&hash=de3e75a5bbb8665af11eda764de0e761e3f262eed827616a2f0b4d3fa9038abb&dl=1">Download the invoice</a>Examples
Rendered by real Gravity Forms and GravityKit PHP against a test entry.
| Merge tag | Output | Without the modifier |
|---|---|---|
{Attachment:18:download} | http://fixture.gravitykit.test/index.php?gf-download=fixture-invoice.pdf&form-id=501&field-id=18&entry-id=5001&hash=de3e75a5bbb8665af11eda764de0e761e3f262eed827616a2f0b4d3fa9038abb&dl=1 | http://fixture.gravitykit.test/index.php?gf-download=fixture-invoice.pdf&form-id=501&field-id=18&entry-id=5001&hash=de3e75a5bbb8665af11eda764de0e761e3f262eed827616a2f0b4d3fa9038abb |
Where the merge tag picker offers it
Form fields: File upload · Post image.