Set up webform for multiple files

Created on 14 August 2024, 3 months ago
Updated 12 September 2024, 2 months ago

I seek help configuring the webform to manage multiple protected file downloads. I have 20 different research papers. I would like to add a link to each one that will send a user to the webform to request the selected file download. (Would be great if prefilling the correct file via the link to the webform could be set up. (Done this in D7. Do not know if this is possible in D10.)

I got the webform to send a single download file link on request by pasting {{ webform_token('[webform_submission:protected_download_url]', webform_submission, [], options) }} into the twig template. (Using themed HTML email with twig template.)

How does one set up for multiple files? As a test I have two handlers added to one webform, each with a different file. How do I set up the element so user can select the right file for download? Using Select element and both tokens have different handler IDs ( example: [webform_submission:protected_download_url:webform_protected_download_01] ), I get plain text, (no download link). Using HTML email with twig template. Thank you.

💬 Support request
Status

Fixed

Component

Documentation

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @sioux
  • 🇬🇧United Kingdom james.williams

    Hi; as you spotted [webform_submission:protected_download_url:webform_protected_download_01] should give you the plain URL. (If it doesn't, then what is it giving you please?) So then make that a link - either using the link button from the formatting toolbar, or wrap it in the appropriate HTML to use the token as the link URL; something like:
    <a href="[webform_submission:protected_download_url:webform_protected_download_01]">Download</a>

    Does that work for you?

  • Status changed to Fixed 2 months ago
  • 🇬🇧United Kingdom james.williams

    Closing due to lack of response; I'll presume the issue was resolved. Let me know if not though!

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024