Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

We have a legacy system that is using the built in Windows commandline ftp client to upload files to an ftp server. It does this using the -s switch, with an ftp file something like the following:

debug
open myftpsite.com 21
<username>
<password>
cd remote_folder
ascii
lcd "c:\myfolder"
prompt
put export.txt export.tx
rename export.tx export.txt
quit

This works 99% of the time, but the other 1% of the time it doesn't. When it runs successfully the resulting logfile contains response messages from the server like "250 OK" after each of the commands above. The problem is sometimes it seems to fail to connect then we get NO messages in the logfile (from the server or ftp client) at all. The ftp client also still seems to return a process exit code of 0.

Does anybody have any suggestions for:

Getting better logging back from the built in Windows commandline ftp client?
AND\OR
Forcing it to return a Process Exit Code other than 0 to indicate something has gone wrong?

share|improve this question
add comment

1 Answer

If it's responding to commands but failing to transfer data (uploads, downloads, directory listings) it could be that you need to enable "passive" mode. Normally FTP requires the server to be able to establish a new connection back to the client for actual data transfer. This rarely works in today's world of NAT, firewalls, and such. And when it is supported, it is actually pretty insecure (since authentication doesn't happen again on the new connection.) So passive mode flips that responsibility around and has the client establish a second connection to the server.

Try setting it in Internet Explorer's advanced setting (which affects many applications, not just IE) or check to see if the FTP client has a passive mode switch. I'm on my iPad at the moment or I'd check myself.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.