Using a File Transfer Protocol program - Michigan State University
Using a File Transfer Protocol program - Michigan State University
Using a File Transfer Protocol program - Michigan State University
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
FTP<br />
1 of 17 9/1/2009 3:19 PM<br />
<strong>Using</strong> a <strong>File</strong> <strong>Transfer</strong> <strong>Protocol</strong> <strong>program</strong><br />
Purpose<br />
Understanding how to use an FTP <strong>program</strong> to upload files to a remote server is critical for<br />
building and maintaining a web site.<br />
In this tutorial sheet you will learn how to:<br />
1.<br />
2.<br />
3.<br />
4.<br />
5.<br />
6.<br />
7.<br />
Create a folder structure to manage your web site<br />
Download and install an FTP <strong>program</strong><br />
Create a New FTP Site<br />
Upload a file<br />
Download a file<br />
Create a folder (directory)<br />
Delete a file<br />
Software Needed<br />
<strong>File</strong>zilla or Fetch<br />
Prerequisite Knowledge and Skills<br />
Before beginning this tutorial please make sure that you have completed the file management<br />
tutorial.<br />
Overview<br />
Creating a Folder Structure to Manage Your site and Downloading and Installing an<br />
FTP <strong>program</strong><br />
Inputting Your FTP Settings<br />
Adding, Deleting <strong>File</strong>s and Creating New Folders on Your Remote Site<br />
[back to top]<br />
Lesson 1: Creating a Folder Structure to Manage Your Site and<br />
Downloading and Installing an FTP <strong>program</strong><br />
What is file-transfer-protocol?<br />
Remember from the Internet Tutorials from SUNY you learned that FTP is both a <strong>program</strong> and<br />
a method for transferring files from one computer to another over the Internet. Specifically<br />
files are transferred between a server and a client (your computer). The most common use of<br />
FTP is to download files, such as in downloading MP3 files. It is also used to upload files to<br />
be viewable on the web and is essential to anyone creating or maintaining a website. To<br />
transfer files using FTP you can use a browser or a software <strong>program</strong> like <strong>File</strong>zilla, also<br />
referred to as an FTP client. Some web page editors like NVU or Dreamweaver have an FTP<br />
client built in. You must have a live Internet connection to transfer files between two<br />
computers over the Internet. An FTP address looks a lot like an HTTP address except it uses<br />
the prefix ftp:// instead of http://. So the FTP address for your AFS space will look like<br />
ftp://afs.msu.edu.<br />
What is AFS space?<br />
AFS stands for "Andrew <strong>File</strong> System". It is "the central MSU network file storage system." It<br />
creates a home directory for faculty, staff, and students. Each registered student, faculty, and<br />
staff gets 100 MB of space. In your AFS space you automatically have a folder called "web".<br />
Any file or folder in this folder can be accessed by anyone with a web browser. (They would
FTP<br />
2 of 17 9/1/2009 3:19 PM<br />
have to know the location and name of the file.) If you want to use your AFS space to backup<br />
important files you should upload them to a folder outside of your web folder. For more<br />
information about your AFS space visit the ACNS help desk at http://techbase.msu.edu<br />
/viewpathfinder.asp?id=144.<br />
How does FTP Work?<br />
When you create a Web page on your computer you will use a <strong>program</strong> like NVU or<br />
Dreamweaver. NVU and Dreamweaver are Web page editor <strong>program</strong>s. Your computer can<br />
also be referred to as the client. So, you’ve got NVU and you’re using it to create a Web<br />
page. Now when you create a Web page with an image it really creates a window for the<br />
image within that Web page. It’s important to realize this because the image is a separate<br />
file. When you insert the image you’re not putting it into the Web page. You’re only creating<br />
the space to view it. So the image is still a separate file. So if you look closely at the picture<br />
on the screen of the computer you see it’s a Web page with an image in it. But it’s referencing<br />
two separate files: the Web page file and the image file.<br />
Now once you’re done creating your page using a <strong>program</strong> like NVU, you’re going to need to<br />
transfer it to a server. People cannot access your computer to see the page. They need to<br />
access the server. In order to transfer the files you’re going to need a <strong>program</strong> like <strong>File</strong>Zilla.<br />
So in this picture, because <strong>File</strong>Zilla is the method for moving the files, the truck represents<br />
<strong>File</strong>Zilla. Now <strong>File</strong>Zilla’s going to transfer the files to the server which you will see on the right<br />
hand side of the screen. Once the files have been transferred you now have a copy on the<br />
server. The server in your case would be your AFS space at <strong>Michigan</strong> <strong>State</strong> <strong>University</strong>, your<br />
space on the network. Now it’s important to note that it doesn’t actually move the files. What it<br />
does is creates copies of files onto the server. You will also have copies if you notice on your<br />
computer still.
FTP<br />
3 of 17 9/1/2009 3:19 PM<br />
Now this is an important thing to understand because if for some reason you make a change<br />
on your computer to your Web page you have to re-upload it, so the server has the most<br />
recent copy of your Web page. You will also notice that both the web page file and image file<br />
have been transferred to the server. All files associated with your Web page must be<br />
uploaded to the server in order for them to be visible on the web. If you only upload the web<br />
page without the image file than you will see the web page with a placeholder for where the<br />
image should be but no image.<br />
Once the file has been uploaded, people can use Web browsers, such as FireFox, which you<br />
will notice on the left hand side, Internet Explorer in the middle, and Safari which is used on<br />
Mac on the right side. But if you look closely at this picture the arrow pointing to your<br />
computer to view the files has a big red X on it. That’s because people cannot access<br />
anything on your computer when they use a browser to view your files.<br />
But what the browsers do is they send a request to the server for the information for your<br />
page, and they put in the URL address and then the server sends the information back about<br />
your Web page, all the information needed to display it through their browser. And that’s why<br />
you need to FTP because people cannot use their browsers to view your Web page on your<br />
computer. You have to create copies using FTP to upload those copies onto the server. Again<br />
if any changes are made you have to update whatever files on the server because that’s what<br />
people are going see when they are going to use their Web browsers to view your Web page.
FTP<br />
4 of 17 9/1/2009 3:19 PM<br />
Why do I need to create multiple folders for my web site files?<br />
As your site grows you are going to have more and more files. If your files are not organized<br />
into folders it will be hard manage your site and find files. Also, over time you may forget<br />
where you saved a lot of your files so a good- more intuitive- site organization will make it<br />
easier to locate your files at a later date.<br />
Most web pages have links to other pages or even images that are displayed within the page.<br />
Browsers need to know where to find those files. Therefore, it is important to have the correct<br />
directory path (This was covered in the file management tutorial- it is the location of the files).<br />
When uploading files to your AFS space you will be uploading them to a web folder in order<br />
for them to be viewable on the Internet. You can only have one index file at the top of this<br />
directory. Since each website begins with an index file you will need to create a folder for<br />
each of your websites in order for them to include an index file. For example when you create<br />
your WebQuest you will create a WebQuest folder and the first page of the site can be<br />
named index.htm or index.html if it is stored in the WebQuest folder. But you cannot just<br />
create your WebQuest right within the web folder of your AFS space because you will already<br />
have the first page of your main web site which is index.htm. So therefore the Webquest<br />
cannot also be called index.htm because it will replace the first page of your main web site.<br />
So in that case you will need to have the first page of your main website directly under the<br />
web folder. Then within another folder called WebQuest you will have the first page of your<br />
WebQuest titled index.htm as well as any images that go along with that WebQuest.
FTP<br />
5 of 17 9/1/2009 3:19 PM<br />
Here is the hard part --- you will be creating the web pages on your computer then uploading<br />
the files to the server (Your AFS space). During the process of creating a page on your<br />
computer, when you enter the directory path (location) of an image, it has to be in the same<br />
location on the server. This means that the directory structure (folder structure) for your web<br />
files on the server (your AFS space) needs to be exactly the same as your directory structure<br />
for your web folders and files on your computer. How your files are organized on the web<br />
server should mirror how your folders are organized on your computer. If the file structure for<br />
your files on the server are not EXACTLY the same as the structure on your computer it is<br />
likely that your links on your web page to other files such as images will be broken. Thus, in<br />
the case of a broken image link, people will not be able to see the image in your web page.<br />
Instead they will see the image of a broken image icon.<br />
For example, if you had two web pages in your site (an index page and a resume page) and<br />
within those pages you were displaying a background image and a picture of the Eiffel Tower<br />
in Windows Explorer your file structure will look like the following:
FTP<br />
6 of 17 9/1/2009 3:19 PM<br />
then if you open your images folder you will see:<br />
On <strong>File</strong>zilla, if you are looking at your web folder, you will see:<br />
If I can FTP files using a Web Page Editor <strong>program</strong>, why do I need to download a<br />
separate <strong>program</strong> just to transfer files?<br />
Web page editors like Dreamweaver will automatically recreate your file structure when you<br />
upload a file- meaning you don't have to select the destination. In NVU, the free <strong>program</strong> we<br />
are using for this course, you will need to know where to upload your files to-- meaning you<br />
will have to select the destination. However, even with a <strong>program</strong> like Dreamweaver<br />
sometimes you may have to use a separate <strong>program</strong> to upload a file if you are troubleshooting<br />
a problem. Also, you may want to upload a file to a folder outside of your web folder. When
FTP<br />
7 of 17 9/1/2009 3:19 PM<br />
you set up a site in a web page editor, you set it to connect directly to the web folder.<br />
Activity 1: Creating a Site Folder<br />
In this activity you are going to be creating a folder that will store all of your web site files.<br />
Within that folder you are going to create another folder (subdirectory) that will store all the<br />
images and supporting files for that web site. For directions on how to create a folder with a<br />
Mac see the Mac <strong>File</strong> Management Tutorial.<br />
1. Click on the Start button , then click on My Documents.<br />
2. If you already created a folder for your MSU classes you are welcome to chose that folder<br />
to store your web folder in or you can just put your web folder in your My Documents area.<br />
There are two ways you can create a new folder. You can go <strong>File</strong> > New Folder and that will<br />
create a new folder within the folder that you selected. Or you can right click in the white<br />
space and choose New > Folder.
FTP<br />
8 of 17 9/1/2009 3:19 PM<br />
3. Either way it will create a new folder and the default name will be New Folder and it will be<br />
highlighted in blue . The blue highlighting shows that text is editable so you will be able to type<br />
in a new name of your folder. We are going to call it web.<br />
4. We are also going to create another folder within your web folder that will store all the<br />
supporting images and files. Double click on the web folder to open it up. Right click and<br />
choose New > Folder.<br />
5. Name the new folder artifacts. This is where you will store any images or supporting files<br />
(Word docs, PowerPoints, etc) that belong with your web site.<br />
Activity 2: Downloading and Installing an FTP <strong>program</strong>
FTP<br />
9 of 17 9/1/2009 3:19 PM<br />
[back to top]<br />
<strong>File</strong>zilla is a free, open source FTP <strong>program</strong>. It is available for both the Windows as well as<br />
Mac operating systems. This tutorial will show you how to download it for Windows but the<br />
steps should be very similar for downloading it for Mac.<br />
1.<br />
2.<br />
Go to http://filezilla-project.org.<br />
Click on the Download <strong>File</strong>zilla Client button.<br />
3.<br />
You will now be on a page that lists latest version of <strong>File</strong>zilla for the different operating<br />
systems. Since I am using a Windows machine I'm going to be seleting the first link<br />
under Windows. If you are using a Mac you would select the appropriate link for your<br />
system under the title Mac OS X.<br />
4.<br />
After clicking on the appropriate link for your system you will get a screen similar to<br />
this. Click on Save <strong>File</strong> to save it to your computer. Note: In this tutorial we are using<br />
the Firefox browser, your steps for downloading may be slightly different depending on<br />
which browser you are using.
FTP<br />
10 of 17 9/1/2009 3:19 PM<br />
5.<br />
6.<br />
Firefox automatically downloads it to the Desktop and opens a Downloads window. If<br />
you double click on the <strong>File</strong>zilla.exe file in the Download list it will begin the installation<br />
process. You may get a message regarding executable files and if you are sure you<br />
want to launch it. Click OK. You may also get a Security Warning saying the Publisher<br />
could not be verified. Click on Run to begin the installation.<br />
As part of the installation process you will have to go through a series of windows. The<br />
first window prompts you to agree to their software agreement. It is always important<br />
that you read any License Agreement of anything that you will be downloading on to<br />
your computer or that you are going to be using such as Web 2.0 <strong>program</strong>s. Once you<br />
have read through the agreement, click on the I Agree button.<br />
7.<br />
In the Installation Options window select Only for me if you are NOTthe only one<br />
that uses your computer. Otherwise you can select Anyone who uses this computer.
FTP<br />
11 of 17 9/1/2009 3:19 PM<br />
To Rename your site<br />
you could also click once<br />
on New FTP site and<br />
then click on the<br />
Rename button.<br />
[back to top]<br />
8.<br />
The next window asks you to choose components you want to install. This is the default<br />
setup so you should not need to change anything on this page. Click Next to continue.<br />
9.<br />
The next window will ask you where you want to save the <strong>program</strong> files. Save them in<br />
the default location which should be C:\Program <strong>File</strong>s\<strong>File</strong>zilla\ Click Next to continue.
FTP<br />
12 of 17 9/1/2009 3:19 PM<br />
10.<br />
The next screen will prompt you to select a Start Menu Folder. Use the default<br />
(<strong>File</strong>zilla) and Click Install to continue.<br />
11.<br />
You will see a new window that will show you the progress of the installation. Once all<br />
the files have been installed on your computer it will say completed and you can click<br />
on the Finish button. To access <strong>File</strong>zilla go to Start> All Programs> <strong>File</strong>zilla FTP<br />
Client> <strong>File</strong>zilla.
FTP<br />
13 of 17 9/1/2009 3:19 PM<br />
Site address bar, the remote site now has the web at the end. Copy the address by<br />
highlighting it and right clicking and choosing Copy.<br />
9.<br />
Go back to the Site Manager by going to <strong>File</strong> > Site Manager. Your site MSU should<br />
be selected. Click on the Advanced tab and where it says Default Remote Directory,<br />
click into the box, then right click and choose Paste.
FTP<br />
14 of 17 9/1/2009 3:19 PM<br />
11.<br />
Now you will see the path to your web folder in the box under Defaul local directory.<br />
When you click on the Connect button you will see the <strong>File</strong>zilla window with your web<br />
folder for your computer on the left hand side and teh web folder for your AFS space<br />
on the right hand side.<br />
You can change your<br />
settings so that when<br />
you login you are<br />
automatically in your<br />
web folder. Go to <strong>File</strong>>
FTP<br />
15 of 17 9/1/2009 3:19 PM<br />
Site Manager. Click on<br />
your MSU FTP Site.<br />
Then click on the<br />
Advanced button. In the<br />
field for the default local<br />
directory put \web\.<br />
2.<br />
In a previous tutorial you should have set it up so that the web folder is already open in<br />
your Local Folder View. If it is not, locate and open your web folder using the Local<br />
Tree pane. If you have located the folder correctly your Local Site path should be<br />
C:\Documents and Settings\user\My Documents\web\. You should be able to see<br />
your artifacts folder in the Local Folder View pane.<br />
3.<br />
4.<br />
5.<br />
Before completing this activity you need to download this sample file here by right<br />
clicking on the link and selecting Save Link As. Save the document in your web folder<br />
in the artifacts folder on your computer. (This is just Microsoft's Resume template).<br />
Don't worry you are going to delete this file in a later activity.<br />
Go back to <strong>File</strong>zilla and double click on your artifacts folder in your local folder view on<br />
the left hand side. You should now see the Resume.doc in your artifacts folder. Click<br />
on the web folder in the Local Tree Pane to have your artifacts folder show back up in<br />
the Local Folder View.<br />
Now you are going to upload your artifacts folder to your AFS space. There are two<br />
ways you can upload the folder. You can click on it and drag it over to the Remote<br />
Folder View pane. Or right click on your artifacts folder and from the menu select<br />
Upload.
FTP<br />
16 of 17 9/1/2009 3:19 PM<br />
6. You should now see an artifacts folder in your Remote Folder View pane.<br />
You can actually move<br />
up a directory by clicking<br />
on the folder at the top<br />
of the Local/Remote<br />
Folder View. The folder<br />
will look like this<br />
7.<br />
If you double click on your artifacts folder in your Remote Folder View pane you should<br />
now see the Resume.doc file.<br />
Activity 3: Create a New Folder (Directory)<br />
In the previous two activities you learned how to download and upload files. FTP <strong>program</strong>s<br />
can do more than just create a copy one file and save it to another computer. In this activity<br />
you will use an FTP <strong>program</strong> to create a new Folder (directory) on a remote computer.<br />
Please make sure that you repeat steps 1-4 and create a folder called WebQuest. You will<br />
need this if you plan on using the WebQuest template.<br />
1.<br />
Make sure that you are viewing the contents of your web folder in the Remote Folder<br />
View.<br />
2.<br />
Right click in the center of the Remote Folder pane and select Create Directory.<br />
3.<br />
A new window to enter the directory name will pop up. Replace the highlighted text<br />
"New directory" with the word temp and click OK. This will give your new folder the<br />
name temp. You will delete it in the next exercise.<br />
4.<br />
Your new temp folder should appear in your Remote Folder View.
FTP<br />
17 of 17 9/1/2009 3:19 PM<br />
Activity 4: Delete a <strong>File</strong><br />
In the previous activities you have added folders and files that you don't need in your AFS<br />
space. You created these to learn how to upload/download files and folders and how to<br />
create a new folder on the remote server. In this activity you are going to delete the<br />
unnecessary files such as the Resume.doc file from both your computer and the server. You<br />
will also delete the temp folder.<br />
YOU MUST BE VERY CAREFUL WHEN DELETING FILES. If you delete the wrong file on<br />
the server you WILL NOT be able to get it back. If you delete a folder, then you will also<br />
delete all of its contents.<br />
1.<br />
Right click on the temp folder in your Remote Folder View. In the new pop-up menu<br />
select Delete. A pop up message may ask if you really want to delete the folder. Click<br />
the Yes button.<br />
2.<br />
3.<br />
In the same pane, the Remote Folder View, open the artifacts folder and right click<br />
on the Resume.doc file and select delete.<br />
In the Local Folder View, make sure that you are in the web folder. The Local Site path<br />
in the Local Tree View should now read: C:\Documents and Settings\user\My<br />
Documents\web\.<br />
4.<br />
Right click on the file Resume.doc in the Local Folder View and select delete.<br />
5.<br />
Remember you have two copies of the Resume.doc file on your computer. There is<br />
another one in your artifacts folder. In the Local Folder View double click on the<br />
artifacts folder to open it. Delete the Resume.doc file in that folder.<br />
[back to top]<br />
Wrap Up:<br />
Go Back to Tutorials<br />
http://edutech.msu.edu<br />
/online/811.htm<br />
In this tutorial you learned how to connect to a remote server using an FTP <strong>program</strong>. You also<br />
learned how to upload files to the server and download files from the server. You will need<br />
these skills in order to make your web site available for others to view through their browsers.