File editing is one of the necessary actions when managing websites file hosted on the server. Best example is to edit PHP files in self-hosted WordPress platform. Though File Manager app is meant for that purpose, it is a hassle to login to your hosting account every time. FTP or File Transfer Protocol is the best option for remotely editing files on the server and FileZilla is one of the best FTP apps for Mac and Windows users. However, FileZilla uses custom filetype associations that can create problems when opening the files. In this article, we will explain how to change custom filetype associations in FileZilla and access the files.
Filetype Associations in FileZilla
Each file extension needs an app to open the file and edit it. Both Windows and Mac use default file association to open each filetype. For example, a CSS file might open with Notepad app in Windows and TextEdit app in Mac. You can change this filetype association in Windows and Mac to open files with your favorite app.
However, certain applications do not follow the operating system’s file association. FileZilla do not follow system’s filetype association. When you open a filetype first time in FileZilla, it will ask you to select an app for opening the file. The selected app will be stored as a custom association within FileZilla’s settings.
Problem with FileZilla Filetype Association
Custom filetype associations in FileZilla generally works well after you choose an app to open the file first time. However, you will face access problem if the previously chosen app is deleted or not available on your device. For example, FileZilla will open PHP files using TextEdit app by default in Mac. Since, TextEdit is not a good app for PHP files we use Brackets code editor for viewing and editing PHP files remotely from the server. As Brackets is outdated, we have deleted the app and installed Visual Studio Code (VSC) editor.
With this scenario, we have changed the PHP file association to open with VSC editor on MacBook. However, when opening PHP files from FileZilla, it showed an error that the filetype association is missing.
As you see, there will be no other buttons to change the filetype association and you will not be able to access the file at all. In addition, the message could mislead you and you might think the problem is on the device level. Whatever the association you setup on your device, FileZilla will continue to show the same error as the custom association will try to look for the deleted app.
View Custom Filetype Associations in FileZilla
If you are struck with the above situation, follow the below instructions to first view the custom file association in FileZilla.
- When you are in FileZilla app, click on “FileZilla” menu and go to “Settings…” section.
- Click “File editing” option to expand it and select “Filetype associations” option.
- Here, you can view all filetype associations that FileZilla app uses.
Click on “OK” button and FileZilla will throw an error indicating the associated application is not found.
Change Custom Filetype Associations in FileZilla
You have two options to change the wrong custom filetype associations in FileZilla. One is to complete delete all wrong associations and connect correct apps and other is to directly change the correct app name in the settings box.
Delete and Reassign Filetype Associations
You can delete all or the problematic custom filetype associations in the box. Press “OK” button to close the settings screen.
Now, right click on the file you want to edit and choose “View/Edit” option. FileZilla will show you the filetype association box and ask you to select the app. You can use the default system app and click “OK” button. In addition, you can check “Always use selection for all unassociated files” to use system app to edit files from FileZilla also. This is a good option as you can rely on the system file association instead of FileZilla’s custom settings. However, after choosing this option you can only change the association by manually adding entries as explained in next section.
If you want to open the file with a custom app, select “Use custom program” and click on “Browse” button to select the app.
Click on “OK” button to create a custom filetype association within FileZilla app. The custom filetype associations in FileZilla should look something like below:
After adding the custom filetype associations, you can edit the file with your favorite app.
Directly Changing App Name
As in our case, we want to change the filetype association from Brackets to Visual Studio Code app. Therefore, we can simply replace “Brackets.app” with “Visual Studio Code.app” in the associations. However, you have to make sure the format is correct. You can use the following format:
- Windows – “C:\Program Files\ Visual Studio Code.exe”
- Mac – php “/Applications/Visual Studio Code.app”
You can find the source app location from the properties of the app. For example on Mac, right click on the app in “Applications” folder” and select “Get Info” option from the context menu. You can find the app name under “Name & Extension” section.
Similarly on Windows, you can find the file path from the “Target” text box of the “Properties” dialog that you can open from the right click context menu. Since, this could easily cause errors, you can follow the first method to safely select the app by browsing through your device.