Is it still necessary to use _ while naming files? - eviltoast

Edit: Thank you guys for your insightful answers!

  • Can-Utility@beehaw.org
    link
    fedilink
    arrow-up
    2
    ·
    1 year ago

    I maintain a number of Drupal websites as part of my job. Our stakeholders have varying degrees of familiarity with the ins and outs of computing.

    A few months ago I got a ticket from one of our stakeholders. Apparently PDF files were broken across large swathes of their site. What happened was Red Hat pushed through an update to apache that closed some security loopholes. As an unexpected side effect, it also meant that any files being served from Drupal’s private file system would break if the files contained spaces in the names. No rewrite rules seemed to fix the issue; we ended up having to go into the rendered HTML and replace all the spaces in the links with ‘+’ signs. They are now told to make sure future files have underscores instead of spaces in the filename.

    So yes, in some cases you still need to use _ (or some sort of non-space character) in file names, even today.