Search code examples
dynamics-ax-2009microsoft-dynamicsaxapta

Dynamics AX 2009: How to FTP from a batch job on an AOS


After quite a few searches for ways to FTP files in AX, I was happy to discover the WinInet class, which is more or less just a wrapper for the .DLL of the same name. I thought my problems were solved! I was not aware, however, that the class had a major Achilles heel -- it doesn't run in batch (on a server).

Can anybody point me in the right direction? Specifically, I want to upload (FTP put) a file to another server in a server-run batch job (running as a service user with admin rights to the file in question). Anybody?


Solution

  • There is another example of using .NET classes for FTP in Axaptapedia. It is different enough from 10p's example code to take a look...

    In my own experience I ended up writing and then calling a bat file from the command line to pass in ftp commands as we needed to use a special FTP client! Here are two examples of using shell scripting - Net Time && Run a Process.