Whitelisting files & directories
By default, only a limited set of directories are accessible through the File System API.
This restriction is to protect your users in the event that malicious or unintended code runs inside your app.
While this scenario is unlikely when following recommended security practices, the possibility of a remote code exploit is never zero, so limiting file system access reduces potential damage.
The default whitelisted directories are:
- The desktop folder. (Except on Mac App Store builds)
- The documents folder.
- The downloads folder.
- The music folder.
- The pictures folder.
- The videos folder.
- The appData folder.
- The temp folder.
- The executable folder.
Files outside the whitelist are still partially visible to the application, but only limited actions are allowed.
For unwhitelisted paths, the application can only:
1. See the file name or folder in a directory.
2. Open the file or directory in the system's native file explorer via the File System - Show In Folder action.
If your application needs access to additional locations, those paths can become whitelisted during the user's session.
However, for security reasons, this can only happen through explicit user actions. Your application cannot whitelist paths silently or automatically.
These user gestures include:
1. The user choosing a save as path from the Show Save Dialog. This will whitelist the path, so that your application can modify/create files at that given path.
2. The user choosing paths from the Show Open Dialog. This will whitelist the path, so that your application can modify/create files at that given path.
3. The user dragging and dropping files onto your application. (Except for Mac App Store builds)
4. The user choosing a download path when requesting a download.