CmdFile.WRITEMODE(TRUE); CmdFile.TEXTMODE(TRUE); CmdFile.QUERYREPLACE(TRUE); CmdFile.CREATE(TheCmd); CmdFile.WRITE('prompt'); CmdFile.WRITE('USER ' + gSRSetup."Registration FTP User" + ' ' + gSRSetup."Registration FTP Passwd"); CmdFile.WRITE('cd ' + fbox); CmdFile.WRITE('mget *.TXT'); CmdFile.WRITE('mget *.txt'); CmdFile.WRITE('bye'); CmdFile.CLOSE; BatchFile.WRITEMODE(TRUE); BatchFile.TEXTMODE(TRUE); BatchFile.QUERYREPLACE(TRUE); BatchFile.CREATE(TheBat); BatchFile.WRITE('ftp -n -s:' + tCMD + ' ' + gSRSetup."Registration FTP Path"); BatchFile.CLOSE;
CREATE(WScript); WScript.Exec(TheBat); CLEAR(WScript);
Comments
Out of desperation I even replaced the WScript code with a SHELL command.
That did at least connect to the FTP server, but it gave me I/O Errors and transferred nothing. Grrr.
I've done it before and this is how I did it:
Where tsAuto is the automation "Windows Script host Object Model".WSHELL.
Also my ftp script that gets created looks like:
OPEN <ftphostname>
<username>
<password>
bin
mget *.txt
quit
And tscommand2 := 'ftp -s:c:\tsFTPscript'
tsWait is a variable of type VARIANT. It did not work with the boolean.
tsWindowStyle is also a variable of type VARIANT.
This has been working for a couple of years now.
Hope this helps,
Regards,
Willy
Also what is the OS where the client is running. You might be dealing with a UAC or other security problem.
Thanks,
Willy
This is the result I get.
Do the files already exist in the target folder? If so, try to move them and then try the FTP again.
Maybe it is something simple like this
your code is this:
can you try:
I think you might be in the wrong directory to do this. You might in a directory where you don't have enough rights to save files. For testing purposes, try ftp the files to the "temp" directory. Also make sure your FTP command script is in the directory you are using.
Regards,
Willy
maybe you could use the "lcd" command in your ftp script to make sure that the local directory is the correct one when downloading.
Also I've experienced problems with up- and downloading and found that by stating "binary" to make sure datatransfer is in binary has solved the problem.
But I have stopped download directly from NAV via NAS because I experienced that every other day the ftp command stops on the server...
Now my ftp download is run from a seperate scheduler and it works every time...(sorry to say)
Best regards,
Henrik Frederiksen, Denmark
You are probably down loading to a folder that you DONT have write permission to! Like 'c:\' or 'c:\program files'. These are by default readonly by the OS.
Use lcd to a writeable directory.
after or before the line
We had problems with hanging transmissions (and blocking NAS) at customer and solved by using a ftp-client with has support for timeouts, like NcFTP Here
Dan Lindström
NCSD Navision 2.00 since 1999 (Navision Certified Solution Developer)
MBSP Developer for Microsoft Dynamics NAV 2009