Script Wysardry
Adapting Perl CGI Scripts

Perl CGI Script Tutorial 5 - Uploading Files.



Home / Script / Tutorial 5

Back | Next

Now that you know what CHMOD and ASCII mode mean, you will need to know how to use them on files and directories with your specific FTP program.  If you are not sure, there are instructions for several popular versions in the FTP section.


Uploading

  1. Start up your FTP program and connect to your CGI-BIN account.
  2. Change to the public_html directory.
  3. Create a new directory called scripts or whatever (okay, I don't literally mean a directory called whatever, but if you really want to, go ahead).
  4. CHMOD the directory to 755 (drwxr-xr-x)
  5. Change to this new directory.
  6. Upload the file in ASCII mode.
  7. CHMOD the file to 755 (-rwxr-xr-x)

Testing it out

You can now test your script by typing the URL into your browser, which will look something like:-

http://cgi-bin.spaceports.com/~user/scripts/hello.cgi

After a short pause you should see the phrase 'Hello World!' in large letters on your screen.  If so, well done - you are ready to move on.

If you see the Spaceports main page instead, then there are 3 possible causes:-

  1. Incorrect transfer mode - you must use ASCII for scripts.
  2. Incorrect file or directory permissions - they must be 755 for scripts and directories containing scripts.
  3. The URL you typed in was incorrect.  UNIX is case sensitive so hello.cgi is not the same thing as Hello.cgi - this applies to directories too.  Another similar cause would be not starting off in the public_html folder to begin with.
Site Menu

Bravenet

Section Menu


Copyright © 2000-2003 Wysardry

Most recently updated on 11 May, 2003

Home / Script / Tutorial 5

Back | Next


Please feel free to contact us with any comments or suggestions
Adapting Perl CGI Scripts
Script Wysardry

This site is hosted by Spaceports