Image upload with spaces in filename breaks in View display

Created on 7 July 2025, 3 months ago

Drupal v10 (we've just realised this has been an issue since the start of the year, so approx 10.3 onwards?)
Webform 6.3
CiviCRM Entity v4.0

When I upload a file to the Image URL field where the filename has spaces, this creates a file URL like
https://mysite.org/civicrm/contact/imagefile?photo=Logo%20with%20border.png where the spaces are replaced with %20

There are no errors when uploading the file, but if we try to include this image in a View by converting this to html using the rewrite function as follows:

This shows a broken link image. If the file uploaded does not have spaces, and therefore the filename is identical to the original file, this appears correctly in the View.

I tried to use the 'Rename files' and 'Sanitize file name' options in the webform but I'm not sure whether they don't work or I'm not using the patterns correctly because whatever I set here does not affect the filename.

I only found a similar problem from a post 9 years ago https://drupal.stackexchange.com/questions/200104/problem-uploading-file...

🐛 Bug report
Status

Active

Version

6.3

Component

Webform/Drupal

Created by

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

Comments & Activities

Production build 0.71.5 2024