You are currently viewing Why dots in file names are bad

As a website designer, I often get sent images and documents to put on client’s websites.  Occasionally they have dots in the filenames, and my alarm bells ring or is that past trauma from a previous experience in the 1990s at college in Ipswich. When my files on my floppy disc went missing, and the technician, who was also a brilliant teacher, had to go into MsDos to retrieve them (that looked something like the Matrix file to me), because I had created a superduper naming system using dots ampersands (these: &) and goddess knows what else. He was visibly annoyed but kept calm and went to great pains to tell me why one should not put these characters into filenames. The files were found unharmed by my incompetence.

Is it bad?

Using dots in file names isn’t inherently bad, but there are several considerations and potential issues that arise with their use, particularly in operating systems and software applications. Here are some reasons why dots might be seen as problematic in file names:

Extension Separation

The most common use of the dot in file names is to separate the file name from the file extension (e.g., document.txt). The extension helps the operating system and applications identify the file type and choose the appropriate program to open it. Using additional dots can obscure the file extension and potentially mislead users or software about the file’s true type.

Compatibility Issues

Different operating systems and file systems have varying rules about the use of dots. For instance, in Unix and Linux, a filename that begins with a dot (e.g., .example) is considered hidden and won’t be displayed by default in file listings. Windows, meanwhile, might ignore or strip trailing dots from file names, which could lead to filename conflicts or loss of information


Would you like help with your website?

Europgen website design
See what we do here


 

Sorting and Organisation

Extra dots in file names can affect the sorting and organisation of files, especially in systems or scripts that parse file names based on the dot character. This can make it harder to locate or identify files based on expected naming conventions.

URL Encoding: When files are served on the web, dots (along with other special characters) need to be URL encoded. This can lead to unexpected behaviour or difficulty accessing files if the encoding isn’t handled properly.

Security Concerns

Malicious users can exploit dots in file names to attempt security attacks, such as directory traversal attacks. For example, crafting file names with sequences like ../ (in environments that support such paths) can potentially allow attackers to access directories and files outside the intended scope.

Ambiguity and User Confusion

Additional dots, especially when not part of the extension, can confuse users about the nature and type of the file. Users might mistake the actual extension or misinterpret the file’s purpose.

In practice, while not inherently harmful, using dots in file names requires careful consideration to avoid these and other potential issues. It’s often best to adhere to naming conventions that are known to work well across various systems and applications you intend to use.

So don’t do it

Use dashes or underscores instead and NO spaces