1

I have imported a lot of files from apache staging to nginx live and the files that have been rewritten by apache (%20 etc) are not being read by nginx, although nginx has no problem with me uploading files with spaces in them it doesnt like files with %20 etc. in the title.

I am using Perusio's nginx config which works great but i cant tweak it to fix this.

Any ideas?

1 Answer 1

1

Think outside the box of web server configuration.

Install the Transliteration module:

Provides one-way string transliteration (romanization) and cleans file names during upload by replacing unwanted characters.

And install the File Field Paths module:

In simple terms, File (Field) Paths allows you to automatically sort and rename your uploaded files using token based replacement patterns to maintain a nice clean filesystem.

Features ...

Retroactive updates - rename and/or move previously uploaded files (Use with caution)

With both enabled you can goto the Content Type's Manage Field page and edit the field with the file(s) and enable Transliteration on the file name to be retroactively assigned to all uploaded files.

This will change the space character ' ' to '_' for all uploaded files.

Then you don't need to worry about difficult server configuration issues. I've used File Field Paths to rename thousands of files successfully on production systems.

1
  • Thanks for your comment but the files are already there and not showing. I prefer to fix things at the level of the server because you are then just throwing thousands of lines of code at something instead of a few stanzas of configuration and generally replacing one problem that you don't understand with a whole set of others! But certainly going forward i will look at transliteration. Jun 4, 2015 at 19:15

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.