Broken email attachments (files, images) with webform
Date Published: March 21, 2023
Issue
Email attachments uploaded via webform are broken, including images or files, with the following error message:
Warning: file_get_contents(private://webform/test/_sid_/1.jpg): failed to open stream: "Drupal\Core\StreamWrapper\PrivateStream::stream_open" call failed in Drupal\webform\Plugin\WebformElement\WebformManagedFileBase->getAttachments() (line 1483 of /mnt/www/html/<subscription>/docroot/modules/contrib/webform/src/Plugin/WebformElement/WebformManagedFileBase.php)
Resolution
Try downgrading the Memcache module to version 8.x-2.1
Cause
As you can see in the error message, the `_sid_` variable is not replaced by its value, therefore the path is invalid.