Publishing Your Files


Got everything organized? Then all that's left is to move everything to the server. Once your files have been uploaded to a directory that the server exposes on the Web, you're officially published on the Web. That's all there is to putting your pages online.

Where's the appropriate spot on the server, however? You should ask your webmaster for this information. Also, you should find out how to access that directory on the server, whether it's simply copying files, using FTP to put them on the server, or using some other method.

Moving Files Between Systems

If you're using a web server that has been set up by someone else, usually you'll have to upload your web files from your system to theirs using FTP, SCP (secure copy), or some other method. Although the HTML markup within your files is completely crossplatform, moving the actual files from one type of system to another sometimes has its drawbacks. In particular, be careful to do the following:

  • Watch out for filename restrictions If your server is a PC and you've been writing your files on some other system, you might have to rename your files and the links to them to follow the correct filenaming conventions. (Moving files you've created on a PC to some other system usually isn't a problem.)

    Also, watch out if you're moving files from a Macintosh to other systems. Make sure that your filenames don't have spaces or other funny characters in them. Keep your filenames as short as possible, use only letters and numbers, and you'll be fine.

  • Watch out for uppercase or lowercase sensitivity Filenames on computers running Microsoft Windows are not case sensitive. On UNIX and Mac OS X systems, they are. If you develop your pages on a computer running Windows and publish them on a server that has case-sensitive filenames, you must make sure that you have entered the URLs in your links properly. If you're linking to a file named About.html, on your computer running Windows, about.html would work, but on a UNIX server it would not.

  • Be aware of carriage returns and line feeds Different systems use different methods for ending a line. The Macintosh uses carriage returns, UNIX uses line feeds, and DOS uses both. When you move files from one system to another, most of the time the end-of-line characters will be converted appropriately, but sometimes they won't. The characters that aren't converted can cause your file to come out double-spaced or all on a single line when it's moved to another system.

    Most of the time, this failure to convert doesn't matter because browsers ignore spurious returns or line feeds in your HTML files. The existence or absence of either one isn't terribly important. However, it might be an issue in sections of text that you've marked up with <pre>; you might find that your well-formatted text that worked so well on one platform doesn't come out that way after it's been moved.

    If you do have end-of-line problems, you have two options. Many text editors enable you to save ASCII files in a format for another platform. If you know the platform to which you're moving, you can prepare your files for that platform before moving them. If you're moving to a UNIX system, small filters for converting line feeds called dos2unix and unix2dos may be available on the UNIX or DOS systems. And you can convert Macintosh files to UNIX-style files by using the following command line in UNIX:

    tr '\015' '\012' < oldfile.html > newfile.html

    In this example, oldfile.html is the original file with end-of-line problems, and newfile.html is the name of the new file.

Using FTP to Upload Files

In the preceding list of tips about moving files, I talked a little bit about FTP. If you already know how to transfer files using FTP, you can just skip this section.

Most web surfers have used FTP whether they know it or not. When you download a file from a remote site to save on your computer, sometimes it's transferred via FTP rather than HTTP. When you're publishing files to a website, the way you use FTP is a bit different.

When you download files from a public site, generally you log in anonymouslythe browser takes care of that for you. When you publish files using FTP, you log in with a specific username and password.

Note

You'll have to get the username and password you'll use to publish files using FTP from your Internet service provider or system administrator.


Another difference between file downloads using FTP and publishing files using FTP is that when you publish files, you'll probably use an interactive FTP session. In other words, rather than just connecting, uploading a file, and disconnecting in one step, you'll create an FTP session, upload or download files as needed, and then disconnect. You'll manually open and close the connection and perform the required tasks while that session is open.

One nice thing about FTP is that there are many clients available. First of all, all popular browsers can be used as FTP clients. That's why you can download files from FTP sites transparently using your browser. However, I recommend that you skip right past them and use something else to publish files. The FTP capabilities in web browsers were designed to make it easy to download one file, not upload an entire website.

One option that's often available is publishing files through your HTML editing tool. Many popular HTML and text editors have built-in support for FTP. You should definitely check your tool of choice to see whether it enables you to transfer files using FTP from directly within the application. Some popular tools that provide FTP support include Adobe Dreamweaver and HomeSite, Barebones BBEdit, and Microsoft FrontPage. Text editors like UltraEdit and jEdit support saving files to a server via FTP as well. There are many others.

If your HTML editor doesn't support FTP, or if you're transferring images, multimedia files, or even bunches of HTML files at once, you'll probably want a dedicated FTP client. FTP is common enough that there are many, many excellent FTP clients available. A list of some popular choices follows:

  • CuteFTP (Windows) http://www.globalscape.com/

  • WS_FTP (Windows) http://www.ipswitch.com/

  • FTP Explorer (Windows) http://www.ftpx.com/

  • FileZilla (Windows) http://filezilla.sourceforge.net/

  • Cyberduck (Mac OS) http://www.cyberduck.ch/

  • Fugu (Mac OS) http://rsug.itd.umich.edu/software/fugu/

  • Transmit (Mac OS) http://www.panic.com/transmit/

  • Fetch (Mac OS) http://fetchsoftworks.com/

How the FTP client is used varies depending on which client you choose, but there are some commonalities among all of them that you can count on (more or less). You'll start out by configuring a site consisting of the hostname of the server where you'll publish the files, your username and password, and perhaps some other settings that you can leave alone if you're just getting started.

Caution

If you're sharing a computer with other people, you probably won't want to store the password for your account on the server in the FTP client. Make sure that the site is configured so that you have to enter your password every time you connect to the remote site.


Once you've set up your FTP client to connect to your server, you can connect to the site. Depending on your FTP client, you should be able to simply drag files onto the window that shows the list of files on your site to upload them, or drag them from the listing on the server to your local computer to download them.

Remote Management Tools

Most HTML editing tools enable you to manage and update the contents of your pages on a remote web server.

Microsoft's FrontPage is a web development tool aimed at small to medium websites. FrontPage provides a WYSIWYG page editor and a site manager for managing document trees and links, as well as a variety of server extensions that can be used with a variety of servers, ranging from Windows-based to UNIX servers.

These extensions enable Frontpage users to add a variety of features, including interactive discussion groups and other interactive features. These extensions also enable you to use FrontPage to upload files on the server as you make changes to your site. FrontPage enables you to publish your website to a remote server, regardless of whether it has the FrontPage Server Extensions installed.

Other site development and management tools, such as Adobe HomeSite, GoLive, and Dreamweaver (www.adobe.com), enable you to develop offline and then update the content on a remote server.




Sams Teach Yourself Web Publishing with HTML and CSS in One Hour a Day
Sams Teach Yourself Web Publishing with HTML and CSS in One Hour a Day (5th Edition)
ISBN: 0672328860
EAN: 2147483647
Year: 2007
Pages: 305

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net