/tutorials/getting_started/article.php/3479421/So-You-Want-An-FTP-Directory-Huh.htm So, You Want An FTP Directory, Huh?

So, You Want An FTP Directory, Huh?

By Joe Burns

Use these to jump around or read it all...

[FTP] [Those Shift Key and Mouse Click Tricks]
[Using Zip Files] [Why the FTP Directory Displays]
[Making the FTP Directory]

     A while ago, I started getting these letters asking me how to make an FTP directory. Apparently people have a series of items they want to offer as downloads. (If you'd like to know more about FTP-ing and downloading, go here.) Well, I didn't know how so I called my Web wizards and they told me all the ugly details. The conversation went something like this (I'm the one in italics).

  • "FTP (File Transfer Protocol) is a totally different protocol (set of instructions) than
    HTTP (Hypertext Transfer Protocol)."
    Meaning what exactly...?

  • "Meaning that an FTP directory has to be set up as a totally different section of the hard drive."
    Can I do that myself?

  • "No."
    ...Uh... why not?

  • "Because the FTP protocols and the HTTP protocols are totally different and cannot be mixed. There cannot be an ftp://www.htmlgoodies.com and an http://www.htmlgoodies.com existing side by side. The ftp would need to be a totally separate directory with its own totally separate Internet Protocol number."
    Oh. But there has to be some sort of equal in HTML.

  • "You would think."
    Well, then -- I will find it.

  • "Then lead on oh great and glorious HTML man of steel and computer knowledge. Lead the people to their FTP as I know only you can! And be sure to misspell some words and throw in some typos while you're at it."
    Okay, then. You have a nice day.

  • "Bye."

     So I gussied up it up a bit. So sue me. You get the point of the conversation. In order for you to have a true FTP directory, you will need to contact your server tech person and ask for a separate section of the hard drive to be set up as an FTP directory just for you. But as I said before, there has to be a way to do this in html alone. I played until I got close to what I wanted. Here's what I came up with. It's an FTP directory listing all of my available images:

Go To My Images FTP Directory

     You wanted something like that I presume? I thought so.

     Now, if you clicked on any of the images, you noticed they just appeared like any other hypertext link. Try this... you Netscape users go back to the FTP directory and hold down the SHIFT key while you click on an image name. MSIE people, click the right mouse button on the image. MAC people can click and hold, then choose to download. Go ahead. Try it.

Okay, I'm going, I'm going.

Those Shift Key and Mouse Click Tricks

     In case you're wondering, the tricks of holding the shift key or specific mouse clicking will work with any link to an image or file. If you do what your browser requires while clicking on any hypertext link, you'll initiate a download of whatever is at the other end of the HREF link.
     What's better still, the SAVE AS that is initiated will automatically save as ALL FILES, or the correct file format, making sure you don't corrupt whatever you are grabbing. Neat, huh?

Using Zip Files

     Have you ever clicked on something and the browser then asked you what you wanted to do with the file? One of the options was to save the file to disc. That's a download. The reason you received that message was because the browser wasn't configured to display or run that type of program, so it asked you what to do with it. You downloaded it.
     Zip files are compressed versions of your regular files. Browsers don't display them, and even if the browser is configured to understand what the Zip file is, the SAVE AS window pops up. It can then be downloaded. So, instead of offering the normal version of the file, offer a zipped up version. It eliminates all that fancy clicking stuff above.

     Here, try it for yourself:

Click Here For JOE.zip

     So now all you need is a program that will zip and unzip files for you. My favorite is WinZip. This program will both create and open zipped up files. See the help section for how-to. It's very simple. The program does 99% of the job. Click on the name to go to their site. The program is shareware so you'll get it free to test out for about a month and then, if you pay a few bucks, it's yours for good.
     I've paid for a good many of my shareware programs. It gets rid of the nagging "pay me" window and usually sets the program up to do more than it did before.

Why the FTP Directory Displays

     When you first posted your HTML pages to your WWW server, you were told to make the "home page" a specific name. Usually it was index.html. Why? Because that is the default file the computer looks for when someone tries to come into the directory. Remember what it said at the top of my images ftp directory? It said "Index of /images".

     So why did it display the index as a list of files rather than as the page "index.html"? Because there wasn't an index.html for it to display. I left it out on purpose to get that effect.
     Now, don't be concerned if your WWW server wants a different name than index.html for the main page. I've had servers ask for default.html, www.html, and HomePage.html. You can set it to any name you want. But whatever the name of the default index page is on your server -- leave it out on purpose -- and you'll get the listing like I got up above.

Making the FTP Directory

     In order to have an FTP directory, you need to create a directory. If you have a program that will create directories for you, great. Use it. Those of us who do not will need to make the directory by hand. Follow these steps:

  • Telnet into your server (enter your log in and password).

  • Get to the directory where you place all your WWW files. You should be able to get to it (if you aren't already there) by typing cd [directory name] and hitting return.

  • Once there, enter mkdir [name]. Place what you want to call the directory where I have [name]. Do not use the [] brackets.

  • If you get no errors, you did it. Now type chmod 777 [name]. If you get no errors, you're done and now have a directory ready to accept files and ready to allow people in.

  • Log out. Put your ftp files in your new directory and forget the index.html on purpose.

     There you go. There's nothing to it. Just remember to tell people to do the shift key and/or mouse click stuff. Or make it easier on your users by zipping up the files for them.


[FTP] [Those Shift Key and Mouse Click Tricks]
[Using Zip Files] [Why the FTP Directory Displays]
[Making the FTP Directory]

  • Web Development Newsletter Signup

    Invalid email
    You have successfuly registered to our newsletter.
Thanks for your registration, follow us on our social networks to keep up-to-date