MacOS – Prevent web browser renaming downloaded files with dot

findermacossafari

I'm new to macOS and trying to set it up. I have my config files in Google Drive, whose names start with dot.

When I download it either with Safari or with Firefox the dot is removed from the file name. I set up to always show dot-files with defaults write -g AppleShowAllFiles -bool true, but that didn't help, the file with dot is downloaded at all.

Is there a way to prevent web browsers from renaming my files completely?

Best Answer

There are several issues with you problem.

First: Downloading a File via a Webbrowser is bound to naming conventions and recommendations which are based on the recommendations from the W3C and RFC's from the IETF, probably RFC3986. There is a Recommendation for URI's from the W3C which include "Reserved Characters". As you can probably guess by that point the dot, as well as double-dot, are reserved characters. In your case the Webbrowsers are automatically renaming the Files with a preceding dot. There is probably no way around that.

Second: Filenames in OSX follow the Unix Schemes in which a preceding dot is marking a file to be hidden (see an interesting explanation to the history here). The Terminal Command you entered is only displaying all files in the Finder, which is irrelevant in you case since you cannot download the File with the preceding dot in the Filename in the first place.

Possible Solution:

1) Try different Browsers, but i doubt that you will find one which doesn't adhere to the naming Conventions

2) you could try the 'Google Drive Sync App'. Perhaps it will sync the files in questions. Since you already displaying invisible files they should show up.