FTP through command prompt.

jadams

2[H]4U
Joined
Mar 14, 2010
Messages
4,086
I can access/read/write to this ftp site with a client fine.

When I try to use it through a command prompt I can connect, enter credentials, change directories, but when I write to it using "put filename.txt" it says connection closed by remote host.

Is my syntax wrong. All the info I've found online says no. But clearly something is messed up.

Eventually want to write a script for a nightly backup.
 
put and get commands dont work.

I can read/write through windows explorer and other ftp clients, but not through command prompt.

EDIT

This is of course using the same login credentials.
 
Perhaps the ftp server only allows binary transfers. Type: bin at the command prompt.
 
thanks for the replies so far

When I try from home I get an error that suggests I try passive mode. I dont have access to the remote router right now to forward those ports. I'll have to troubleshoot that at another time

Whenever I try it from in the office from the server that is doing the backup I dont even get prompted to try pasv mode.

Rison - i tried both binary and ascii. Both modes produce the same results.
 
Generally cmdline ftp is the one that does work, when all the fancy clients don't.

create another user and try that?
 
I'm 90% sure hawk82 is right. This is, or was, a fairly common problem. It's usually because FTP is an odd protocol compared to most. Most modern firewalls have workarounds to handle the issue.

If you're trying to fetch from a vendor site and they're saying that others customers are not having problems then it's likely on your end. Do some searching for how your firewall/router handles FTP. You can probably get by switching from PASV to Active or vice versa. If that doesn't work, do a search how Active or PASV FTP works and figure out which firewall rules need to be put into place to get it to work.
 
When I try from work and home, both times I'm behind a pfsense firewall. They are configured very similar.

It may be the firewall that the ftp server is behind. I'll have to check out that router next time I have access to it.
 
The built-in ftp.exe in windows does not support passive mode. Sounds like the server is passive only.

You'll need to get a cmd line client (the equiv of ncftp) on windows that supports passive mode or get the ftp admin to change the firewall and ftp server config to deal with active clients.
 
Back
Top