Edit Files "Live" Via FTP With Notepad++ [How-To]

If you run your own web site and run Perl, PHP scripts or the like, there will be instances where you have to edit some files from time to time.

The long way to do it is to download the file you need to edit, modify it, then upload it back.

The short way is to edit the file "live" on the server directly. Using Notepad++ this is easy to do with it’s built-in FTP feature.

First, enable FTP folders by clicking the small yellow folder icon at top:

image

You will see a right and bottom pane appear, similar to this:

image

In the FTP Folder window at right, click the settings icon (the gray one that looks like a gear).

You’ll get a window like this:

image

Click New (bottom left button) to start a new profile.

Enter Profile as the friendly name you want to remember this FTP server by, such as "My FTP Server".

Enter Address as the FTP server you want to connect to, followed by your username and password.

If using Windows XP, you don’t have to set anything else up.

If using Vista or 7, you do have to set the Use profile cache directory to a local writable folder (such as My Documents for your local Windows account). If you don’t do this, you will not be able to edit any files "live".

When done, click OK.

To the left of the settings icon you clicked is a blue plug-looking icon:

image

Clicking this will bring up your server list. It will show the entry you just created. Click your entry and you will establish an FTP session with your server.

From there you can double-click any file you want (as long as it’s text based) to edit, seen below.

image

After double-clicking a file it will open in the editor as a tab (each successive file you open will create more tabs). Make your edits, then save the file with the save button or CTRL+S, and it will be saved direct-to-server.

Free eBook!

Like what you read?

If so, please join over 28,000 people who receive our exclusive weekly newsletter and computer tips, and get FREE COPIES of 5 eBooks we created, as our gift to you for subscribing. Just enter your name and email below:

Post A Comment Using Facebook

  • Jack

    Nice, but you can’t create files with Notepad++ in FTP folders? With PSDpad you can create an empty file.

  • Jack

    Aah sry, you can, just create new file and “Save as”

    • http://www.menga.net Rich Menga

      I guess I should have mentioned that. Not the most elegant thing in the world but it works. :)

  • Tommy

    I don’t get it. How you use “new file -> save as” to create a new file on the ftp? The save dialog is just a standard windows dialog with no place to select the ftp?

    • http://www.menga.net Rich Menga

      The “new” part is to set up your FTP access in Notepad++. After logging in, you double-click any editable ASCII file (php, html, etc.) on the remote file list, Notepad++ will local-cache it temporarily while you make your edits. When you save, it will save the changes in the cache, then upload the updated file direct to the server.

  • weehawker

    I think Notepad++ is great. If there was a Linux version, I’d probably use that on my home system. But a couple of times lately, Notepad++ has crashed and the open file got lost: saved with zero bytes! I know windows sucks and all, but is there a way to prevent this from happening?

    • http://www.menga.net Rich Menga

      On the Linux side, gedit pretty much does everything Notepad++ does (it has a plugin system so it can be extended out quite a bit.)

      The “trick,” if you will when running Notepad++ on Win Vista or 7 is for editing files via FTP “live,” on creation of an FTP profile, check the box for “Use Profile Cache” and specify a folder somewhere in My Documents (I suggest creating a folder for each FTP site you use.) On XP this isn’t necessary, but on Vista/7 it’s more or less required because of writing permissions stuff.

      If it’s local files you having issues with, click Settings / Preferences, hit the “New Document/Open Save Directory” tab, see the bottom and specify the My Documents folder as your edit dir. This should take care of any crash issues. Also, if you’re editing a lot of UNIX-specific text files, tick the option for “Unix” under format in that same tab.

  • http://blog.zeemp.com/ Paulo Miranda

    Thanks, it really helped a lot! Simple and cool post!

  • dave

    It doesn’t look like FTP is normally included, at least with the latest version of Notepad++, at least under Windows. I just freshly installed Notepad++ v5.5.1 and there isn’t a “small yellow folder icon at top” as pictured.

    I eventually found that what’s missing is the FTP_Synchronize plug-in. I found a link to download it from this page:

    http://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=Plugin_Central

    The download had a FTP_Synchronize.dll file that needs to be copied to C:\Program Files\Notepad++\plugins.

  • jlemm

    Be warned, if Notepad++ crashes during an edit of a remote file, you will lose the content of that file (happened to me a couple of times and I lost valuable code this way).
    So keep a copy or don’t use Notepad++ for remote file editing until it becomes more stable.

  • http://cheapnchalu.com Prasoon Joshi

    Thanks. Nice post. Always wanted something like that; have been using Notepad++ for quite sometime now but never noticed this … lol …

  • http://www.kadimi.com/ Kadimi

    The plugin FTP_synchronize is not included in the current stable release 5.6.4, you need to download the plugin and install it

What’s Your Preference?

Daily Alerts

Each day we send out a quick email to thousands of PCMECH readers to notify them of new posts. This email is just a short, plain email with titles and links to our latest posts. You can unsubscribe from this service at any time.

You can subscribe to it by leaving your email address in the following field and confirming your subscription when you get an email asking you to do so.

Enter your email address for
Daily Updates:

Weekly Newsletter

Running for over 6 years, the PCMECH weekly newsletter helps you keep tabs on the world of tech. Each issue includes news bits, an article, an exclusive rant as well as a download of the week. This newsletter is subscribed to by over 28,000 readers (many who also subscribe to the other option) - come join the community!

To subscribe to this weekly newsletter simply add your email address to the following field and then follow the confirmation prompts. You will be able to unsubscribe at any time.

Enter your email address for
Free Weekly Newsletter: