0

Im new here and currently building my first Drupal website. Im having trouble creating a webform because i cant find the file input option to include in the form. When i googled it, i found that the file input should be available as an element to choose from, but i still cant locate it.

I am using Drupal 10. Any advice on this would be greatly appreciated. Thanks for your help!

1
  • You did not configure Drupal’s private file system. If you check the site status report and certain webform admin pages you will see a warning about that.
    – mona lisa
    Commented May 16 at 3:29

1 Answer 1

1

To enable file inputs for webform, you have two options:

  1. Enable Allow files to be uploaded to public file system in the elements configuration on /admin/structure/webform/config/elements. Uploaded files will then be stored in the public directory (sites/default/files/SOME_DIRECTORY). Keep in mind that files stored in the public directory are accessible from anyone. If you have sensitive files, it's safer to use a private directory. For more information, see Drupal file upload by anonymous or untrusted users into public file systems -- PSA-2016-003.

  2. Alternatively, configure your private file system. Add the following line to your settings.php file.

    $settings['file_private_path'] = realpath("{$app_root}/../private");
    

    Create the private directory and set its permissions to 755.

After implementing this setup, you'll find different file inputs available. enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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