My webform allows file uploads, but I want to save them in a specific folder within the private folder (private://form_name/submission_id/original_file_name.ext). How do I do this?

I see the Rename files option, but I am unsure what token I could use to maintain the original file name and/or specify the path.

  • Can this maybe be done with the retroactive update as described in How to make existing public files private? There I needed to make public files private. But I guess the same would work with just changing the path.
    – leymannx
    Jul 27, 2020 at 21:38
  • @leymannx Can the FileField Paths module be used with the Webform module? Is there any setting for the FileField Paths module to make it change the file upload form fields used from Webform, or does it work out-of-the-box?
    – apaderno
    Jul 28, 2020 at 7:18
  • @kiamlaluno – Worth a try. Or at least a starting point to have a look at its code. In the end it's all about files. No matter if from a Webform element or from a file field. Looking at drupal.org/project/issues/… it seems as if Webform support was once requested but a patch was never provided.
    – leymannx
    Jul 28, 2020 at 8:53
  • 1
    @leymannx And the request for adding Webform support was for Drupal 6. I take that means explicit support for the Webform module isn't really necessary because, as you said, the Webform module uses the same form field other modules use for allowing file uploads. Thank you for your comment. I asked to help the OP understand why we are pointing him to the other question.
    – apaderno
    Jul 28, 2020 at 9:18
  • There is not an interface on Webforms to set the Path using FileField paths. This sounded promising, but I could not figure out how to make it work. Jul 31, 2020 at 12:07


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.