Notepad++ is without doubt one of the most important tools you have as a developer (at least in a windows environment). When you work with PHP it is, in my somewhat humble opinion, completely crucial.
One of the things that make is so good is the NppFTP plugin which lets you upload files and images with ease. I’ve been using it for ages and the FTP plugin is one of the main reasons. In this post I will show you how to use it (if you for some reason have missed it):
NppPlugin should be preinstalled in the latest editions of Notepad++, and if it isn’t you can go to this place and download and install it. Open it by going to Plugins => NppFTP => Show NppFtpWindow. This will add a new window to notepad++ to the right and will look something like this:
The three important buttons are (Dis)connect, Settings and Show Message Window (show console). The first thing you need to do is to create a connection to your FTP, so press the Settings button and select Profile Settings. The following window will be shown:
Press Add new in the lower left corner to add a new bookmark and give it a name. Then fill in your hostname (such as ftp.example.com), choose an appropriate port (normally 21), enter your login credentials and if you want an initial remote directory (this is optional, so if you don’t mind, just leave it empty), then close the window:
If you press the connect button you should see your bookmark, select it to connect:
Now, using it is quite straight forward. To create a new folder on your ftp just right click in the ftp window and select Create new directory. The same goes for creating new files. If you have a locale file opened that you want to upload just right click and select Upload current file here.
If you need to upload an image you can actually do it in notepad++. Embarrassingly enough I just figured out how to. I’ve normally used NcFtp on the side (which I still will for bulk upload/download and cleaning) but you can do it in notepad++ as well by just selecting the Upload other file here in the right-click menu.
All files that you work on are saved locally on you computer as well which is handy if you have some sort of disaster on your server :). The files can be found in Documents and Settings (AppData in Vista) in the user files for notepad++. You can see where your files are saved whenever you save a file that’s originally from the ftp. In the top bar of notepad++ you’ll see the path to the local copy of the file.
Tips and tricks
There are some things you need to remember when working with files on your ftp via notepad++:
- Files are automagically uploaded when you save them.
- If you rename a file on your ftp via notepad++, remember to close the file if you have it opened before doing additional changes. Otherwise the changes will only be applied to your local copy of the file with the old name.
- Have the console open as it will point out if an upload failed (which happens every once in a while for different reasons).
- Sometimes when deleting files or uploading NppFTP won’t update accordingly, use Refresh from the right-click menu on the folder in question to see the changes.
- In the Profile settings there is a tab called Transfers where you can toggle connection mode between Active and Passive.