I have blog entries with img tag references to images that have spaces in their filenames. The spaces in the link are represented with a %20, and this was verified by inspecting the body field of the prefix_node_revisions table. If I pull out the URL to the image and type it straight in my browser, drupal redirects the browser to the URL with all spaces converted to %20, then returns a Page Not Found error.

Drupal is installed in the root of my site. The images are in /files/blog/, and the associated URL is http://[FQDN]/files/blog/[filename].

E.g., if I type http://site.com/files/blog/a b c d.jpg, drupal redirects the browser to http://site.com/files/blog/a%20b%20c%20d.jpg, and I get Drupal's Page Not Found error even if a b c d.jpg really exists in that directory.

Images without spaces in the filename display just fine.

This behavior happens regardless of the Download method selected in Administer > Site configuration > File system.

Comments

aren cambre’s picture

Whoops, should have reported more info.

Site is hosted at 1and1.com. PHP is version 5 (forced through .htaccess).

aren cambre’s picture

Title: Filenames with spaces are not displayed » Images with spaces in filename are not displayed (get Drupal's page not found error)

Adjusting title.

aren cambre’s picture

Should have mentioned that I have Clean URLs turned on, although I don't think that should matter.

sun’s picture

You definitely should test Transliterate filenames module. Please report back if that module works for you (and mark this issue fixed if it does).

aren cambre’s picture

Status: Active » Closed (fixed)

I am going to go ahead and close this out. This was an experimental site, and I have long discarded it.