FTP File from Windows to Unix Server

Your rating: None Average: 4.5 (18 votes)

Here is how you can FTP a file from your windows client machine to a Unix server box.

Open the command line by going to Start > Run and type cmd.

You should see something link this:

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\compshack>

Now, navigate to the location of the file you would like to FTP. Mine is located under c:\temp\
cd c:\temp

Lets type the ftp command:
ftp database_name

You should see something like this where you will get prompted for the userid you will be login to the server with as well as the password:
Connected to database_name
220 database_name FTP server (Version x.x Tue Jul 6 21:20:07 CDT 2004) ready.
User (database_name:(none)): your_userid
331 Password required for your_userid.
Password:
230 User your_userid logged in.

Issue the command below to check the default login location for this server:
ftp> pwd

and you should see something like this:
257 "/incoming/files" is current directory.

If this is not the directory you would want to FTP the file to then issue a CD command to get to the desired directory:
ftp> cd /temp/files
250 CWD command successful.
ftp> pwd
257 "/temp/files" is current directory.

It looks like we are all set, lets FTP a file called my_file from c:\temp to /temp/files.
note: you would use the put command to ftp the file, and the put command allows to change the file name on the fly. So, in my example I'm changing the file name from my_file to test_ftp.txt
ftp> put my_file.txt test_ftp.txt
200 PORT command successful.
150 Opening data connection for test_ftp.txt.
226 Transfer complete.
ftp: 5151 bytes sent in 0.01Seconds 515.10Kbytes/sec.
ftp> bye
221 Goodbye.

C:\temp>

Please try to help out with unanswered topics on the forum. Chances are you have had the same issue/question some time in your IT career!

Comments

Have a question? Please ask it on the forum instead.
ksuchetan's picture
User offline. Last seen 10 years 12 weeks ago. Offline
Joined: 09/23/2008
Posts: 1
Re: FTP File from Windows to Unix Server

Hi,

this did not work for me

ftp> cd /temp/files
250 CWD command successful.
ftp> pwd
257 "/temp/files" is current directory.
till this place everything seemed to be fine

then when i executed

ftp> put test2.txt test1.txt
200 PORT COMMAND SUCCESSFUL
553 test1.txt permissions denied

Please advice

Thanks In Advance

Lepa's picture
User offline. Last seen 8 weeks 6 days ago. Offline
Joined: 06/23/2008
Posts: 591
Re: FTP File from Windows to Unix Server

Hi ksuchetan,

2 things that might cause your "permission denied" error.
1. You don't have permission to create files into /temp/files directory or,
2. test1.txt file is already in /temp/files directory and you don't have permissions to overwrite it.

Give back to the community and help it grow!
* Help with unanswered forum questions and issues
* Register or login to share your knowledge at your own blog

Guest's picture
Guest (not verified)
Re: FTP File from Windows to Unix Server

Thats correct

Guest's picture
Guest (not verified)
Re: FTP File from Windows to Unix Server

How to automate the above process

Dhinil's picture
Dhinil (not verified)
Re: FTP File from Windows to Unix Server

Is there a way we can directly change the file permission while placing it to server.

Ankit Kaushik's picture
Ankit Kaushik (not verified)
Re: FTP File from Windows to Unix Server

Hi KSUCHETAN,
This I think is because your user ID doesnt have the permissions for transferring into the location you are trying to. Kindly check the permissions for writting and then FTP, this will most probably allow you to transfer without any errors.
Thanks and Regards,
Ankit Kaushik.