Information
Total Authors: 15
Total Articles: 40
Komodo Edit is a fairly decent PHP editor which includes a number of useful features. The best is that it's quick and unobtrusive with its help. The downside to a free version of a proprietary software system is that it doesn't include some necessary features. One of these features is FTP of course.
When working on a web project it's often necessary to upload the modified files and test them on a development or production web server. Dreamweaver has a number of methods which test remote files for changes, allow FTP uploads and downloads, and provide synchronization. Although these features aren't always necessary, the bare minimum seems to be integrated FTP management in an IDE. While Komodo Edit offers many useful features, it seems to miss on this necessity.
I'll show you a way to get Komodo Edit to upload a single open file using FTP through the command line. This process only works on Linux (tested on Ubuntu) since the curl functions are built-in.
First, open Komodo Edit and select Tools - Run Command (Ctrl-R)

In the "Run:" text area you can type in this command:
curl -T '%F' ftp://domain.com/www`echo %F | sed 's#%p##g' | sed 's#%f##g'` --user username:password
There are several parts to this command in order to upload the file to the correct folder. It assumes that the folder structure is created already.
"curl -T '%F'" tells the curl program to upload the file denoted by %F.
The ftp connection is made to the root directory by using "ftp://domain.com". I've pointed the target directory to "ftp://domain.com/www" by default.
Additionally, I've attached some processing on the Komodo variables to specify the correct target directory based on the file location relative to the project folder. This is done using this command: echo %F | SED 's#%p##g' | sed 's#%f##g'
%F signifies the full file path on the system.
%p is the project folder path on the system.
%f is the filename of the selected file.
We start with the full path, then use sed to remove the project folder path, resulting in the relative child folder and the filename. The filename is then removed because it's not needed.
The additional parameters in the FTP command are the username and password.
The only thing left to do is check the "Add to Toolbox" option and you are done creating the command.

If the Toolbox isn't displayed you can go to View - Tabs and Sidebars and check Toolbox. You'll see your command listed. You may modify the command to change the name if you like.
Using It
To use it you have to open a file you would like to upload to your FTP site and then double-click on the command in the toolbox. It will not upload a file that is not open and it will only upload the active tab.
While this isn't the best method, it does give Komodo Edit a little bit more flexibility. At least you'll be able to upload the file you're currently working on to the server without opening up another FTP program.
Comments (0)