File naming best practices will make life easier for your users. Some of you may remember the old DOS days when file names could be no more than 8 non-space characters long, plus a three-letter extension. This of course was one of the many prickly issues in the then-vehement PC vs. Mac wars, as the MacFolk were not so constrained. MS Windows’ eased this issue, and now it’s just a distant memory. Except for this rule: your file names must not include these characters: \ / : * ? ” < > |

So when freed from curmudgeonly rules limiting how we can name files, what are the common-sense rules to naming files? Does it really matter?

Yes and no. If your file will never be used beyond your own computer, it doesn’t really matter. Name rour files in whatever way makes sense to you. But it starts to matter if you plan to share the file, either with other humans or with the Internet.

Spaces make for unruly URLs

When you include spaces in your file names, and if that file is posted online, then the URL to that file will have spaces–which is something the web servers of the internet generally don’t like. So to get around it, the space is replaced with an “escape code”–which in this case is characters %20 (here is a table of more escape codes). So if your file name is “This is the important file.pdf” — the system will refer to it as “This%20is%20the%20important%20file.pdf.” That looks just lovely, right?

Instead of spaces, use hyphens or underscores:

This-is the-important-file.pdf
This_is_the_important_file.pdf

or my favorite option: go mixed-case to just close it up.

ThisIsTheImportantFile.pdf

People need to read it too

While the length of a URL doesn’t matter if someone is just going to click it on a web page or in an email, it becomes important when it’s something you are going to have in print. Keep the file name nice and short so your URL can be short too. Picture it: You have made a beautiful brochure which invites readers to download a solution brief to learn more about your new Confabulating Reticulator product. Which URL would you rather your customers have to type in?

www.yourdomain.com/files/Confabulating%20Reticulating%20Product%20Brief.pdf

or

www.yourdomain.com/files/ConfabRetic.pdf

See what I mean? Of course, you can always use a redirect that would assign a shorter URL to longer document names.

Embedding date and revision info

Some people like to embed date or revision info in a file name. For example:

ConfabRetic-01mar13.pdf

This is a good practice for internal revisions of a document, such as those revisions before a document is complete. However, once a document is final and ready to post online, in some cases it is best to remove that information from the file name.

Look at the case of a company that maintains a wiki or intranet of important reference files for its team, or a company that hosts a site with links to reference materials that are updated on a regular basis. If the file names change every time the file is updated, that adds quite a bit of overhead to maintaining that site: Every time the file is updated, someone must edit the link on the page to keep it current. If the file name stays the same, all you have to do is upload the file to overwrite the previous version, and that’s it. You can almost call that automation!

Moral of the story

Even though your computer allows you great flexibility in naming files, think ahead to how the file will be used. Take pity on the user that will have to type that name into a web browser, and be mindful of how the name will look once the escape codes are entered in place of spaces.

 

Tagged with:
 

Comments are closed.

Set your Twitter account name in your settings to use the TwitterBar Section.