FutureQuest, Inc. FutureQuest, Inc. FutureQuest, Inc.
Uploading In ASCII
Posted on 24 October 2003 05:56 PM
The #1 reason for a script to return an error is that it has not been uploaded to the server in ASCII format. It is vitally important that all scripts are uploaded in ASCII for them to work. If you are not sure how this is done, the following quick-tip tutorial should help.

If you are using an FTP program, click on HELP and search for the word ASCII. This should lead you to a section that will explain how to assure the program is in fact uploading your file in ASCII mode. Most FTP programs offer you three options:

  1. Auto Detection (allowing the program to decide)
  2. ASCII Mode (text)
  3. Binary Mode (images)
Auto Detection will work fine for most files but usually does not work well for scripts. Many FTP programs, that upload files with .cgi or .pl extensions, will upload them in binary mode and this causes the script to be broken. When you are uploading a script via FTP simply make sure that you have chosen to upload in ASCII and do not allow the program to decide this for itself.

If the file is already on the server, you can use the File Manager in the CNC to convert the file from binary to ASCII. Once you have logged into your CNC, just select the file and then click the DOS/Unix Conversion button from the menu. Doing so will automagically turn binary files into ASCII files for you!

For advanced users comfortable with SSH, there is a second way to turn a file into a clean ASCII file. Make sure you are within the same directory that the file is in. Usually this is your cgi-bin so you would type

cd /big/dom/xdomain/cgi-bin/ {enter}
(where xdomain is replaced with your xdom)

Now type

stripcr filename.cgi {enter}
(where filename.cgi is replaced by the actual name of the file you want to fix)

stripcr tells the server that you want to strip the carriage returns from the file. The carriage returns are what cause a file that was not uploaded in ASCII to break.

The above should help you to prevent any further script problems that occurred due to the most common script mistake on the Internet. Enjoy!