Problem uploading files and images containing spaces in the filename In Drupal 8 I have fields of type File and Image, inside Content types and forms. These fields stores files inside the "public" folder.

When I upload files with a name containing spaces, for example a file named "example with spaces.pdf", the file is correctly uploaded but once uploaded it is no more available.

The image below is just after uploaded an image containing spaces in the filename. Note that all seems correct:



When I save and publish the content I get this:



And returning back in the edit panel the thumbnail is no more available:



Same problem above trying to upload files inside a field of type File.

The file's url becomes something like this:

localhost:8888/sites/default/files/2016-05/example%20with%20spaces.jpg


But I'm redirected to the home page trying to open such url. Maybe there is a bug in Drupal when translates the url encoded filename in the real one.

If the filename has no spaces, or if the file is uploaded inside the "private" folder, there are no problems.

Any idea about how to solve this problem?



EDIT

I can reproduce the error with following steps:


Download Drupal

$ drush pm-download drupal --drupal-project-rename=drupal

Install Drupal

$ cd drupal
$ drush site-install standard \
--db-url='mysql://[db-user]:[db-pass]@localhost:[db-port]/drupal' \
--account-name=admin --account-pass=password \
--site-name="Drupal" \
--site-mail=noreply@example.com

Start Drupal

$ drush runserver

Create a new 'Article' and upload an image with spaces.


Maybe is there something wrong in steps above? Or a bug in the drush's built-in server?
Just I checked on different types of image files. So it could not reproduce your error. In my opinion, if your problem is in the server settings or the settings of the Drupal 8. Because viewing the forums, the Internet, communicate with colleagues at work, such a mistake, I have not met anybody.