web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Uploading file to ftp in batch mode

(0) ShareShare
ReportReport
Posted on by 1,055

Hi,

I have this job that generates a couple of files and writes them on to the ftp.

However, now I want the same job to be batchable.

I wanted to know if its possible to do that in batch mode?

I am making use of a .net dll for ftp transfer process.

Is it possible to do so?

Can someone share a link for reference?

Many thanks! :)

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    235,979 Most Valuable Professional on at
    RE: Uploading file to ftp in batch mode

    Obviously the assembly or one of its dependencies can't be loaded. Either they're not installed or they can't be loaded to 64-bit process. If you're unable to find the problem by yourself, use Assembly Binding Log Viewer.

  • Community Member Profile Picture
    on at
    RE: Uploading file to ftp in batch mode

    I have path to pick the CSV file, the file will be encrypted and converted to *. GPG format which client requires processing the file. It should be processed through Batch with expected intervals.

    I have created the AX Batch class to perform this operation. Its working fine when I run the process through menu item if I add the menu item in batch then the issue stops me to proceed further.

    Dot Net team has created the *exe and DLL for encryption which is installed in x86 in the same AX server.

    I have installed the DLL in Client Bin and Application Bin(AOS).

    Kindly suggest me your input to resolve this.

  • Martin Dráb Profile Picture
    235,979 Most Valuable Professional on at
    RE: Uploading file to ftp in batch mode

    It seems that you're using an assembly that you haven't installed on AOS.

  • Community Member Profile Picture
    on at
    RE: Uploading file to ftp in batch mode

    Dear Martin,

    I will be getting the below issue when generating file(FTP) through Batch.

    Kindly provide your input to resolve the issue.

    Issue:

    System.ApplicationException: Unable to Upload the files to FTP ---> System.IO.FileNotFoundException: Could not load file or assembly 'WinSCPnet, Version=1.2.9.5665, Culture=neutral, PublicKeyToken=2271ec4a3c56d0bf' or one of its dependencies. The system cannot find the file specified.

      at CTLienServices.ftphelper.UploadToSFTP(String ftpServerIP, String stringsFtpUserID, String stringsFtpPassword, String FolderPathforCSVfiles, String stringHostKey, String FTPServerPath, String PortNumber)

      at CTLienServices.EncryptionService.EncryptAndUploadFilestoFTP()

      --- End of inner exception stack trace ---

      at CTLienServices.EncryptionService.EncryptAndUploadFilestoFTP()

    Regards,

    Raja

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: Uploading file to ftp in batch mode

    Yes, You can do it in AX

    Create a class in AX ClassA

    extend ClassA to RunBaseBatch

    Create a main() method in the class

    Call run() method in main() method

    in run() method implement you logic

    Compile the class to no error

    Create Action Menu Item using class

    Run Action menu Item

    Once Action menu Item runs you will find a dialog box with Batch tab

    you batch tab to setup your process for batch processing

    Validate if batch job is running and you are getting your expected result.

    Please verify and update if information provided is helpful

    Please let me know if you need any further technical help related to this.

  • Suggested answer
    Martin Dráb Profile Picture
    235,979 Most Valuable Professional on at
    RE: Uploading file to ftp in batch mode

    Yes, unless you use some logic that requires AX client (which is not available in server batches).

    If you currently execute your code in a job, i.e. on client, you may potentially run into some issues with the fact that the AOS is (usually) on a different machine and it's a 64-bit process, while the client is a 32-bit one (supposing you're using a recent AX version).

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Syed Haris Shah Profile Picture

Syed Haris Shah 9

#2
Mea_ Profile Picture

Mea_ 2

#2
Rahul Shah Profile Picture

Rahul Shah 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans