• Skip to primary navigation
  • Skip to main content
Sal Ferrarello
  • About Sal Ferrarello
  • Speaking
  • Connect
    Mastodon GitHub Twitter (inactive)
You are here: Home / Computing / How to Name a File
Hello My Name Is Sticker

How to Name a File

Last updated on July 5, 2018 by Sal Ferrarello

Naming a file, while seemingly an easy task has a number of nuances to it.  Here are some tips to improve your file naming.

A rose by any other name, would smell just as sweet but would be more difficult to locate.

Use all lowercase letters

A combination of upper and lowercase letters in a file name makes for easy typos in urls.  Windows servers by default are case-insensitive but the W3C standards group says urls should be case-sensitive and this is the behavior on most *nix servers.

Minus signs instead of spaces or underscores

Spaces in urls get encoded to %20, which makes for messy and confusing urls so we replace them with a character.  Underscores can get lost when a filename is underlined so minus signs are used in place of spaces.

Dates

If you need to include a date, please:

  • put the date at the beginning of the file name
  • use the format YEAR-MONTH-DAY
  • use 4 digit year, 2 digit month, 2 digit day

examples:

2014-12-25-example-file.pdf

2014-07-31-example-file.pdf

One of the advantages of this format is, when sorting alphabetically these files will be chronological.

Note: The official name for this date format is International Date Standard ISO8601.

Photo credit Quinn Dombrowski

Sal Ferrarello
Sal Ferrarello (@salcode)
Sal is a PHP developer with a focus on the WordPress platform. He is a conference speaker with a background including Piano Player, Radio DJ, Magician/Juggler, Beach Photographer, and High School Math Teacher. Sal can be found professionally at WebDevStudios, where he works as a senior backend engineer.

Share this post:

Share on TwitterShare on FacebookShare on LinkedInShare on EmailShare on Reddit

Filed Under: Computing, Dev Tips

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Copyright © 2023 · Bootstrap4 Genesis on Genesis Framework · WordPress · Log in