Uploading Your Files

Congratulations, you've created your web site! You've completed the various tasks of site design (your 'theme' and topics, format, page layouts, use of graphics and sounds) and implementation (writing the content, creating the pages) and now it's time to publish your site!

Publishing your web site is commonly thought of as Uploading, that is, moving your files from the hard drive of your computer to a computer on the internet (your web server or 'web host').  I will expand this definition of 'publishing'  to include other activities which must take place at the server to ensure your web site remains viable, and will include Maintenance and Testing. We'll address only Uploading in this topic.

Sometimes people get 'uploading' and 'downloading' confused. The way to view it is that files which are sent from the small computer (you) to the big computer (server) are uploaded. Bringing files down from the server to your PC is downloading. You'll also hear someone say 'put the CD in your computer and download a certain file'. Similar, I suppose, since it's headed toward your PC, not away from it.

The process of uploading or transmitting your web site's files across the Internet is performed using the Internet's 'File Transfer Protocol', or 'FTP'.  Some computers on the internet may only be used for FTP and are known as 'FTP Sites'. Your web server computer is also an FTP Site, even though it's a 'Web Server', as well..

There are two primary tools we have available which do our FTP for us. You can use one of the many specialized (called 'standalone' or sometimes 'dedicated') FTP programs or you can use the upload (FTP) feature of your HTML editor, if it has one, and many do. PageMill 3.0 can do this, as can FrontPage 2000, and quite likely yours.

Initially, we want to transmit ALL our web documents and graphics to our assigned web server location. This isn't too hard to do and we have no real risk because there's nothing there yet. You only need to know your userid and password (assigned by your ISP or web hosting company) and some knowledge of your FTP program. However, once we start changing and adding files, the upload process starts becoming risky. Also, we're going to become 'best friends' with our FTP program and get to know all of its functions and idiosyncrasies.

A major concern we'll soon have is the synchronization of our many web files between our development PC and our remote web site. After our initial upload, we will change many HTML pages, perhaps rename  image files, add a sound clip, and so on. The dilemma now is, how do we remember what changed? Do we just go to our server and delete everything and then re-upload everything? Of course not; that could take forever. Do we write all our changes onto a sheet of paper, hope we don't forget something, and then manually upload and delete? Not if we can help it! I did this for a while and watched my blood pressure climb.

The answer is (and you knew this all along didn't you?) that we will  instruct our FTP software to "automagically" update the server with new and changed files OR to synchronize our PC to our server. Let's hold off on synchronization for a few minutes because that's a very special case and very dangerous. Updating and adding new files is much more important, much easier and much safer, so we'll look at that first.

There is only one important consideration when having our FTP program perform an automatic update, and geez is it important ... timestamps ! All files transferred to your server will be evaluated in terms of whether they are new files or modified files. New files are obvious, but the 'timestamp' of the files at your PC and at your server is the critical determinant in knowing whether a file has been modified.

As an example, let's say we just changed one of our web pages, for the first time in a week or so. This is one of the files which we want to upload. Well, we shouldn't have a problem because that file's timestamp on the server will be much older and the FTP program will quickly recognize that ours is newer (or modified). So, now we upload it and all is well. However, in 10 minutes we decide we must change it again and upload it again. Or perhaps we'll wait an hour or two and change other files and upload them all together.

Here's where we can get into a bit of trouble and it will usually be blamed on time zone differences between our PC and our server's..

My server is running on Greenwich time, which is very bad for me because I'm located East of Greenwich. I'm hours earlier (4 or 5 depending on EDT vs EST) and if I upload a file, continue to work on that file and then, say, 2 hours later do an upload, the server's version of my file will 'appear' to be more recent because it put a Greenwich timestamp on it which is later (more recent) than mine, and it won't automatically upload.

Knowing this can happen, you can always 'force' the file(s) to upload, by specifying 'always upload' or 'forced upload' instead of depending upon file timestamps. However, you can do a lot of work in a couple hours and you may have changed a dozen or more pages, moved a few images into a different directory, changed a half dozen graphic files, and other changes. What you will prefer to do is have your FTP program deal with this for you.

A good FTP program will allow you to specify the time zone difference between your PC and your server and it will adjust the real timestamp at the server by the proper number of hours before it makes the decision whether your PC's file is newer. So, the file I uploaded 3 hours ago when it was 8:15 PM is timestamped on my server at 1:15 AM the following day. Now, 3 hours later, my PC's file is timestamped at 11:15. However, the FTP program will subtract my 5 hour time difference from the 1:15 AM Greenwich timestamp, realize that it was placed there at 8:15 my time, and will now upload it automatically.

It may seem that I've belabored this point, but I really have not. There are other causes for faulty timestamp comparisons than time zone differences. I've seen servers which are set to some number of minutes, perhaps an hour or more,  earlier than they should be. Guess what, now my files which I've recently uploaded are assuredly going to be uploaded again (and waste time), because the server had originally timestamped them incorrectly, making mine still appear newer. This problem, as you have probably realized by now, is what also happens when your PC is in a time zone WEST of Greenwich and you didn't adjust for the time zone difference. You're always later than the server's time and your files are uploaded repeatedly.

So ... for a successful upload you need to understand your server's clock relative to your own. Servers are usually set to GMT but more than occasionally are NOT. I've also seen situations where a 'bug' at the server causes its time to be totally inconsistent, varying even by days.

Your FTP software will likely produce a 'log' of the files it sends and you may want to review that log after a major upload. Also, it may have a 'dry run' or 'test' capability where it can tell you what it's going to do before it does it. And ... when all is said and done, you should upload your files as much off-peak as possible and test the changes you've made thoroughly. Be especially on the lookout for graphic files you forgot to upload with the pages that required them.

After all I've just said, your only comfort level at first may be to upload manually, in small chunks, and test as you go along. No one will poke fun at you for doing this, and surely it's 'better safe than sorry'.

A Tip for the Do-It-Yourself'er:

If you want to avoid FTP 'automation', try this:

Many good FTP programs use a Windows Explorer type of presentation with your PC files in a left panel and the server files in the right panel.

Move through your web one directory at a time and click the 'date' column heading to sort the files with the  most recent dates at the top. This will make it easy for you to manually select the ones you recently worked on and do a 'forced update'.

I had deferred discussing synchronization because of the additional risk it imposes and because it's not quite as important. Nevertheless it offers incredible benefit. The primary function of synchronizing files from your PC to your server is that this process will not only do the upload of new and changed files, but it has the option of deleting files from the server which no longer belong there. The ability to delete files is its blessing and its danger.

You have to develop a medium to large web site to appreciate all the litter that's there. One example is the dozens of background textures that you were experimenting with and no longer need. Or, the many pages you renamed by copying them and leaving the originals behind. Or, the dozens of graphic images that just didn't work out. At some point we have to deal with this clutter because it not only wastes space but it's confusing to anyone collaborating on building the web site and eventually will be confusing to you. So, it's good to have a tool to get rid of it.

The gist of synchronization is that you're instructing the FTP program to look for files on the server which are not on your PC and 'get rid of them'. This is cause for extreme caution and necessitates FTP offering you a 'dry run' or 'test' function, as mentioned earlier. If you think there's peril here, consider that synchronization can work in reverse and adjust your PC's file to match what's on the server. And ... you can have 2 way synchronization which makes the PC and the server files the same. You may say, now, enough of this Sam, no way I'm getting involved with this. But later on you're going to be awfully tempted to do it.

An important point on synchronization! Don't use this feature until you are completely sure about what you're doing !! You must understand your web site, your server and its timestamping, and also must be intimate with all your applications. With some really bad luck you could accidentally specify that you want your web server synchronized to your PC, which would result in many of the files on your PC being deleted if they're not yet uploaded.

In summary, take it slow at first,  just have your FTP program upload files which have changed or which are new files you're adding, or for that matter, do it manually if you're more comfortable. Don't worry about all the useless files you have at the server which you've long ago deleted from your hard drive. Just manually delete the ones you know about using your FTP program and use full synchronization when you're more confident.

In the Maintenance topic we'll look at some ways your HTML editor can help you find the clutter for manual deletion. And ... I know I don't have to tell you, keep your web site files backed up frequently (tape, zip drives, even diskette) and don't ever depend on your server personnel to keep you 100% safe.

A few final words about selecting an FTP program. I have chosen "WS_FTP Pro" as my dedicated FTP program and can easily  recommend it to you. It is one of the more popular FTP programs and I've found it to be quite intuitive, well-documented, and easy-to-use. If you go to Ipswitch's web site , the FTP Pro version is available for sale or for trial download (30 days). There's a Limited Edition version available at no charge for home, non-commercial use. It doesn't have all the bells and whistles of the Pro version but is very good.  Or you can go to, say, DaveCentral and look at one of the many shareware, freeware FTP programs. I hear "Cute FTP" mentioned frequently. Your ISP may also give you some FTP program free. Just make sure you're happy with the program you use and please make sure you understand it.