On my site, the visitors can download whitepapers as pdf. I would like to gather some information before handing over the file. Updates: the downloads should be open to unregistered users

What I tried: I looked around for modules. Some of them seemed to do something like this but were Drupal 7 only, like Webform Protected Downloads. On the site I can make use of the Webform module as per this question. I could make a form with a redirect page where the file can be downloaded. However, as there are many whitepapers, for each one there should be made a separate form and download page. Update: in Webform it is possible to stay on the same page and output a thank you message with download link, so that will limit the effort somewhat.

Is there a simpler way to solve this?

  • 1
    I'm voting to close this question as its too broad – No Sssweat Feb 5 at 9:25
  • What should I do to narrow it then? – C.A. Vuyk Feb 5 at 9:39
  • Could you not have people create a user account, and then only allow downloads to authenticated users? Add the info you want to the account fields.You could tweak the phrasing on the user registration page so that the registratrion does not deter too much. – Menno van den Heuvel Feb 5 at 10:25
  • Thanks for the suggestion, I will update the question, the downloads should be open to unregistered users – C.A. Vuyk Feb 5 at 11:05

Instead of creating different webforms for each file, you could just have one form that can handle this. Here is my suggestion:

  1. Make all links to your whitepapers to load a webform and pass the filename as a parameter for your webform. You can then store that on a hidden field on the form.

  2. Create a custom submission handler for your webform to trigger a download upon submission (use the filename from the hidden field on the form).

| improve this answer | |

To stream (and protect) the file, you should try using https://www.drupal.org/project/webform_confirmation_file

| improve this answer | |
  • very good suggestion, I will try this also – C.A. Vuyk Feb 6 at 14:35

Not the answer you're looking for? Browse other questions tagged or ask your own question.