Welcome to WebmasterWorld Guest from 54.145.208.64

Forum Moderators: incrediBILL

Message Too Old, No Replies

Spaces in filename - Potential problem?

I have PDFs that have spaces in the name

   
4:32 pm on Nov 27, 2007 (gmt 0)

10+ Year Member



I have several PDFs that I have to serve up and the current filenames have multiple spaces in the name like "ABC Widget Spec Sheet.pdf" and I don't want to rename which would make for confusion. Am I going to run into any problems serving these pages(Apache 1.3)? My experience tells me no, but is there any browser specific issues (or any other issues for that matter) that I might run into?
7:08 pm on Nov 27, 2007 (gmt 0)

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Well, modern browsers and file systems **will** correctly connect with file names with spaces, but IMO it's still a bad idea.

<a href="ABC Widget Spec Sheet.pdf">See PDF</a>

When you follow this link, here's what appears in the address bar, or the URL that gets bookmarked:

http://www.example.com/ABC%20Widget%20Spec%20Sheet.pdf

Uhhhhg-Leeee. It's just a sloppy way to work. If you like the file-name recognition, use underscores or dashes:

ABC_Widget_Spec_Sheet.pdf
ABC-Widget-Spec-Sheet.pdf

2:33 pm on Nov 28, 2007 (gmt 0)

10+ Year Member



I agree that the %20 is ugly, but I do have many files that I would have to replace the spaces with dashes - anyone have a perl one-liner or command line command to replace all spaces with dashes by any chance?
2:56 pm on Nov 28, 2007 (gmt 0)

10+ Year Member




% rename 'tr/ /\-/' *

That did the trick on linux anyway.