Web Hosting Manual & Guide

CHAPTER FIVE - Uploading and Downloading Files

5.1 INTERFACING WITH YourMagicHost

5.2 ASCII AND BINARY MODES


5.1 INTERFACING WITH YourMagicHost

In all the sections below, a distinction is made between transferring ASCII files and binary files. This is important -- you must transfer files in the appropriate mode.
Perl scripts and HTML files are ASCII files, along with many others. If you use a plain text editor to work with a file, it's an ASCII file. It's not terribly important to transfer HTML files in ASCII mode, but it is important for Perl scripts.
GIFs and JPEGs, as well as audio and video files, are binary files. They must be uploaded in binary mode, or will be corrupted. Files that look like garbage in a plain text editor and require a more advanced program to edit are not ASCII files, and must be transferred in binary mode.

5.1.1 FTP - Graphical Interface (wu_ftp, fetch, etc.)

Users with graphical interfaces can run a program such as WS_ftp, cuteFTP, or fetch to interface with YourMagicHost. Just log into your domain name with the username and password we provide you. If you do not have your own domain name, we will provide you with the name of our host where your username resides. (Or, follow the instructions in 5.1.3 and note the machine name in the login prompt.) See (1.2.1.3) MS Windows Access in Chapter One for details.

5.1.2 FTP - Shell Interface

For Unix users, at the shell prompt, type ftp your-domain.com. Then enter your username and password when prompted.
ASCII files (text)
Type ascii to make sure you are in ascii mode.
Type put filename to put a file.
Type get filename to get a file.
Binary files (graphics)
Type binary to make sure you are in binary mode.
Type put filename to put a file.
Type get filename to get a file.

5.1.3 Telnet - Graphical Interface

Simply run the program on your machine that contains telnet in its name. Then log onto your-domain.com (or .net or .org) with your userid and password.
Once logged on, you may use the following commands (assuming your telnet program knows or can be taught about ZMODEM, which often isn't the case):
ASCII files (text)
Type rz to put a file.
Type sz -a filename to get a file.
Binary files (graphics)
Type rz filename to put a file.
Type sz -b filename to get a file.

5.1.4 Telnet - Shell Interface

At the shell prompt, type telnet -8 your-domain.com. Then enter your userid and password when prompted.
Once logged on, you may use the following commands:
ASCII files (text)
Type rz filename to put a file.
Type sz -a filename to get a file.
Binary files (graphics)
Type rz filename to put a file.
Type sz -b filename to get a file.

5.2 ASCII AND BINARY MODES

Go up and read 5.1. It's covered there.
So why this section? If this seems obvious, sorry, but probably the single biggest type of problem we have to correct or tell users to do over is problems caused by having the wrong mode active. We needed this in big letters so you'd find it.
Macintosh users: in Fetch, the binary mode referred to throughout the manual is 'raw'. The other option uploads too much data, corrupting the file.
In case you're wondering what the fuss is about -- aren't text files standardized? -- here's the explanation. While ASCII is a standard for encoding text, it does not specify how to end lines. There are two obvious candidates in the ASCII character set: CR and LF. *nix machines, such as the YourMagicHost WWW machines, use LF to terminate lines. Macintoshes use CR. DOS, Windows, and NT machines use CR LF (both, in that order). When transferring files between machines of different types, you need to account for this, hence ASCII mode. To avoid damaging binary files (where the bytes don't have the ASCII semantics) there is binary mode.



 

 © 2003-2019 Magic Scripts | Valid XHTML