Using WinSCP3 to Upload Your Files (Windows)

This page documents WinSCP3 for Windows. The program is free and can be downloaded at this location:

http://winscp.net

NOTE - The page you will be directed to is not intuitive and lists other products which are not required for the purposes of our classes!

Ignore all references on their page to the U3 and Plugin downloads.

You should be downloading the latest release of the WinSCP program. You do not need the U3 and Plugin downloads!

At the time of this writing, the latest release is 3.8.2 and is listed on the page as WinSCP 3.8.2 released. Click the download link below the latest release version.

WinSCP3 is installed in our laboratories, though it might not be the latest or same version you download.


How to Connect with WinSCP3

  1. Open the WinSCP3 Program by double-clicking on the application.

  2. The login window will open when the program is launched.

  3. Fill in the connection information and click the Connect button to initiate the connection.

    Log in window screenshot

    Host Name: - This is the name of the machine in our unix lab that you want to connect to. This example shows losaltos.fhda.edu, but you really can use any of the hosts listed below. It really doesn't matter which host you connect to, it only matters that the machine is turned on and ready to communicate :)

    If you are unable to connect to losaltos.fhda.edu, try one of the following:

    losaltos.fhda.edu
    kyoto.fhda.edu
    paris.fhda.edu
    london.fhda.edu

    User Name: - Replace smithbob with YOUR username that you obtained from the accounts server... remember that it is case-sensitive!

    Password: - Enter YOUR password that you obtained from the accounts server... it is also case-sensitive!

    Port: - Leave this at 22, the standard port.

    Protocol: - Choose SFTP (allow SCP fallback).

  4. If this is the first time that you have connected to this host, you will see a dialog similar to the example below:

    Authenticate dialog screenshot

  5. Click the YES button to accept the encryption key.

  6. Assuming that you provided the correct username and password, the following example screen should appear displaying the files in your home directory.

    Remote listing of files screenshot

    The pane on the left side of the window lists the files on your local hard drive and the pane on the right lists the files in your home directory on our UNIX machine.

    The first time that you connect you will only see one folder that has been made for you named public_html. All of your web published files should be placed into the public_html folder... that is your default web directory.

  7. So prior to uploading a web file, ensure that you double-click on the folder named public_html.

    To copy a file from one pane to another, highlight the file and then press F5 to copy the file. You can also drag a file or folder from one pane to another... and, you can drag a file from anywhere on your hard drive to a pane.

Transferring Files

  1. If you are uploading web published files, remember that they should be uploaded to your public_html web directory.

    In the pane on the right, double-click on the public_html folder to open it. After doing so the folder name above the file listing will then indicate public_html.

  2. Click on a file/folder in the pane on the left to select it.

  3. Click the Copy button at the bottom of the window or press F5 to transfer the file/folder to the other pane.

    Drag and Drop - WinSCP supports drag and drop. You can pick up a file and drag it to the other pane. You can also pick up a file from anywhere on your hard drive and drag it to a pane.

Deleting Files and Folders

  1. To delete a file or folder, select it in the file list and click the Delete button at the bottom of the window or press F8. A confirmation dialog will be displayed.

Folder/File Permissions

In our labs, we've found that any folder that you create or copy to our machines with WinSCP seems to have the permissions set such that anyone can write to or delete the folder. SO, you should ensure that the permissions are set correctly for your purpose.

The illustration below shows the permissions as being incorrect for both web and UNIX students.

Permissions window screenshot

Folders that you intend to publish to the web should be located in the public_html folder and must have the permissions set so that others (the server) can read and execute the directory, but not write to it!

Permissions window 2 screenshot

Folders belonging to UNIX students, which are not being published, needed to be locked down so that only the owner can do anything to the folder!

Permissions window 3 screenshot

To set the permissions of a file or folder:

  1. Select the file or folder in the list.

  2. Click the Properties button at the bottom of the window.

  3. Set the correct permissions.

  4. Click the Set group, owner, and permissions recursively button.

  5. Click the OK button in the window.

Accessing Your Web Files via a Web Browser

Either of the following should get you to your web files. The top example uses the tilde character which our web server assumes you mean you want the web directory (public_html) for the specified user. The lower example spells out the complete path to the user's web directory.

Browser URL bar with address screenshot

What can go Wrong?

Do the File Names Match the Links?

Remember all that harping we do in the lecture about file name conventions?? Not following that advice may be coming back to haunt you now. Here are some things to look for:

  • Space and Weird Characters - There should not be any spaces in the names of the files. Sure it worked at home or in the lab, but it won't work once you transfer your HTML files to the UNIX server!

    Truth be told, UNIX does allow spaces in file names, but you don't know how to code your HTML files to tell the server there is a space in the name... so no spaces, ever!

    Delete the files from the server using your FTP tool, change the file names, and change any links in the code to match the new file names, then re-FTP the files back to the server and test.

    There should also be no special characters in the filename. The only acceptable characters are letters, numbers, and the underscore character. If you've got things like " & + = ... then you're going to have trouble because Browsers and Servers use those special characters!

    Same solution as above!

  • Case Sensitivity - UNIX servers are case sensitive (where have you heard that before:) This means that if your code points to a file named foo.html and you upload a file named FOO.HTML... those are not the same to UNIX. Sure it worked on your Mac or PC, but...

    Either change the name of the file to match the link, or change the code to match the filename and then re-FTP the files back and test.

  • Wrong Delimiters - Did you incorrectly use the IBM-PC delimiter of \ This will work on a PC using Internet Explorer, but not in Navigator and certainly not on the UNIX platform! Examples of wrong delimiters are:

    PC Delimiter, a backward slash -      images\logo.gif
    Mac Delimiter, a colon -      images:logo.gif

    When coding HTML you should always use the UNIX delimiter / (yes even on a PC or Mac), so that it looks like images/logo.gif

    Fix the delimiters to / and re-FTP the files and test!

 

Top of page August 10, 2010