A Guide to FTP (File Transfer Protocol) and Folder Permissions

Introduction

If you are in the position of having your website built on your local machine and are wondering how you get your website 'live' on the web or you are trying to install a script on your website and are having trouble getting it to work then this tutorial is for you. In it I will cover FTP (File Transfer Protocol), Filezilla which is free to use FTP software and also folder permissions.

What is FTP (File Transfer Protocol)?

FTP or 'File Transfer Protocol' is probably easiest to understand as the way in which computers can talk to each other and exchange files. It is far quicker than e-mailing or sending a file on a disk and it is really what makes the World Wide Web possible. You can upload your website to a server in a totally different part of the world in a matter of seconds. FTP also maintains your website folder structure. Lucky really or your website would be a mess once it was live on the internet!

In order to use FTP you will need to tell it which server to upload your site files on to and which folder to put them in. You will also need to provide a username and password to gain access to the server. Most web hosts will provide you with all of this information when you sign up for an account.

Filezilla

Filezilla LogoAlthough the more advanced web design software, such as Dreamweaver, provides an in-built FTP solution I find that Filezilla gives me much better control over my website files and folders. Filezilla is free to use FTP software and it can be downloaded from the internet. Click here to visit the Filezilla site and get the software (link opens in a new browser window).

Once you have Filezilla downloaded you will be able to connect to your website in a few easy steps. NB: Make sure that you download the Filezilla Client and not the Filezilla Server as they are right next to each other on the page at the time of writing this tutorial.

  1. Click on 'File' and then 'Site Manager'
  2. When the dialogue box comes up select to add a 'New Site' and name it something appropriate
  3. Make sure the 'General' tab is selected and fill in the connection information provided to you by your hosting provider (see example image below)
  4. Click on 'Connect' and you should see your website folder structure appear in the window on the right hand side. If this happens you are good to go!
Filezilla Screenshot

If you use computers regularly the you should become familiar with how Filezilla operates very quickly. It is just like dragging and dropping folders and files around your own PC or Mac desktop. You can upload and then change and manage all the apsects of your website that you should ever need to. As I said earlier, I have not found an FTP client built in to any other software that even comes close to Filezilla for flexibility and reliability.

So, now that you are connected to your web server through Filezilla, the second part of this tutorial will cover how to understand and change folder permissions.

Folder permissions

NB: The permissions part of this tutorial applies to UNIX/Linux based servers only and although Windows does have a permission system, it's different and cannot be set by anyone using an FTP client such as Filezilla. Check with your hosts if you don't know what platform your website is hosted on.

It is important to understand how folder permissions work as installing scripts etc. may well ask you to set folder permissions to make them operate. It is also important for security reasons to have your folder permissions set correctly. Folder permissions will protect your website files and instruct your server how to deal with certain files and folders. You may also see changing folder permissions referred to as CHMOD. This stands for 'Change Mode' and it simply means that you are changing the permissions for a folder or file.

Permissions are split into groups to allow different permissions to be set for different groups of users. These groups are;

Group Description
Owner Usually whoever uploaded or created the file. This is you if it is your website
Group Other registered hosting users on the actual server or common resources that are setup to run under this permission group
Public This is the public or generic internet user

Folder permissions come in three flavours; read, write and execute. This means that you can allow a certain type of folder access based on what group the person wanting access to the file or folder sits in. It should be fairly obvious what read, write and execute mean as they do what they say. Read will only read what is in a folder, write means that a folder or file can be written to and execute means that a script or an action in a folder can be executed or actioned. You will see folder permissions written as either a number or as text. Below is a table showing what these numbers or text mean;

Number Text Permission
0 --- None
1 --x Execute
2 -w- Write
3 -wx Write and Execute
4 r-- Read
5 r-x Read and Execute
6 rw- Read and Write
7 rwx Read, Write and Execute

So, how does this all fit together to create a folder permission? Looking back at Filezilla, in the window that shows all of your website files, right-click on the folder that you want to view or change the permissions for and then select 'File permissions' at the foot of the list;

Filezilla Screenshot

This will bring up the following dialogue box which covers the groups and permission levels covered earlier in the tutorial;

Filezilla Screenshot

In the example screenshot above you will see the folder is set to the most common permissions configuration. This is;

Group Read Write Execute
Owner
Group
Public

As we discussed earlier this can also be written the numeric way as '755' or using the text way as '-rwx r-x r-x'

If you are trying to install a script on your website the easiest way to change the folder permissions through Filezilla is to type in the number that is required to match the script you are installing. This should then alter the tick boxes above it to reflect the changes you have made. If the script you are installing does not mention what the correct folder permissions should be I would be surprised. Make sure that you have read all of the 'read me' files that have come with the download. If you still can't find the information you need and the script won't work then contact the author directly.

Conclusion

Hopefully this tutorial has helped to explain FTP and folder permissions and you will now have greater control over your website folders and a correct and secure permissions structure. If you have had any trouble installing scripts on your website in the past then you might want to revisit them now and check what the correct folder permissions are to get the script running correctly.

Advertisements If you would like to advertise on Corrosive Online then get in touch through my Contact Page for details.
Join The Mailing List
    If you have found anything on this site useful or entertaining or you have enjoyed one of my Online Web Design Lessons then I would love you to make a donation. Use the Paypal button below to make a donation.