Windows FTP outputting differently when used under UC4 9 then when run straight from box

Discussion created by Ezekiel_Gable_1177 on Dec 18, 2014
Latest reply on Dec 18, 2014 by wingsofred
Hello all,

Hoping you can help me with a problem that has been plaguing us for over a month now. First though, some quick background. I apologize in advance for the length- just trying to be clear.

For years now, we have had a process by which we send a file to a client via FTP once we receive it on on our file server. We have had no reported issues until about a month ago. Now, they are claiming that occasionally we are sending 0kb files. We have implemented a dir command in our UC4 job before the FTP comand to read the byte size before and rule out the possibility that the file is still building. Since we've done that, we've never seen a 0kb file on our end but they still report receiving it frequently.

During troubleshooting, we have sometimes run the commands manually from our FTP server. When we do this, we noticed that the regular windows FTP program would return several things to the screen that weren't in our log files. Chief among them are the FTP return codes for each line and, if the file wrote successfully, the bytes sent. Further testing proved that it wasn't just running the commands manually that produced these superior results, but merely running them from the box directly. 

In other words, we run ftp with a text file as input like this:
ftp -d -s:d:\batch\FTPcommand.txt

-d enables debugging, which we have on because we are trying to get as much info as possible -s indicates a text file to read from for the commands. In the text file, we have commands such as:

open ftp.customerserver.com
cd incoming
put LocalFilename.txt RemoteFilename.txt
dir RemoteFilename.txt

If we run the above FTP command in UC4, all we get back is something like this

USER username

PASS password
cd incoming
CWD incoming
put LocalFilename RemoteFilename.txt
PORT 12,6,198,151,221,1
STOR testAgain2.txt
dir test.txt

When we run the same command straight from the command line, we get output like this:

220-FTP server ready.
220-          All data and information held on or in, or generated by this
220-          system is proprietary and confidential. Any unauthorised use
220-          or unauthorised  disclosure of such  information is strictly
220-          prohibited, and may result in legal action against you,
220-          including but not limited to criminal or civil prosecution,
220-          to the full extent permitted by applicable law.
220-          All use of this system is subject to monitoring, retention
220-          and disclosure to the extent permitted or required by
220-          applicable law without further notice to you, and accessing
220-          the system constitutes your consent to such monitoring,
220-          retention and disclosure.
220 This is a private system - No anonymous login

USER username
331 User username OK. Password required

PASS password
230-User username has group access to:  41940
230 OK. Current directory is /
cd incoming
CWD incoming
250 OK. Current directory is /incoming

Then if we put a file successfully, we get results like this:

226-File successfully transferred
226 0.131 seconds (measured here), 107.18 bytes per second

What is happening in UC4 that is getting us such different results? 

We've already tried a few different things like outputting the standard out to a log file, encapsulating the whole command into a batch file or a new cmd shell (and several combinations thereof!) but have had no success. Any idea whats going on here?