Skip to content

Step 10 – FTP Upload

Step 9 wrote a file listing what Sage 200 did with each order. The file is in a folder on the IMan server, where the system that sent the orders cannot reach it. In this step you upload it.

Like Step 5, this step has two parts:

  1. An FTP server record in Setup, holding the address and credentials.
  2. An FTP task on the design surface, which uploads the file.

Setup > FTP Servers

You define a server once, then choose it by name in any FTP task. The credentials are kept in one place instead of in every integration that uses them.

  1. Save the integration. In the left-hand menu, press Setup, then FTP Servers. The screen that opens is headed FTP OR SSH.
  2. For training, a server called LOCAL is already defined. Double click the row to open it. Add creates a new one.

    The FTP OR SSH setup screen listing one server, LOCAL, with the Add, Edit and Delete buttons above the grid

  1. Id
    • Identifies the server. It cannot be changed once the record is saved.
    • For training: LOCAL
  2. Description
    • The FTP task lists servers by description, not by id, and a vague description is hard to find later. The System Connector in Step 5 works the same way.
    • For training: Local SSH
  3. FTP or SSH
    • SSH transfers files over SFTP. FTP is plain FTP.
    • For training, leave as: SSH
  4. FTP Server Address/IP
    • The server, by name or address. For training it is the IMan server itself, so: localhost
  5. Server Port
    • 22 for SSH, 21 for FTP, unless the service listens somewhere else.
  6. Username / Password
    • The account IMan signs in as. The password field hides the password as you type.
  7. Connection Timeout / Idle Timeout
    • Seconds to wait before giving up on a slow or unresponsive server.
  8. SSH Private Key / SSH Key Password
    • Key-based authentication instead of a password, for servers that require it. Leave both empty to sign in with the username and password above.

The FTP server record for LOCAL, with FTP or SSH set to SSH, the address localhost, port 22, the username SSHUser and a masked password

FTP or SFTP?

This training uses SFTP, the SSH option. SFTP encrypts both the credentials and the file, and needs one port instead of FTP's separate control and data ports. Most servers now expect it.

Testing the connection

Press TEST at the bottom of the form. A tick on the button, and a second one in the Ftp Server Results panel beside it, confirms that IMan reached the server and signed in. The System Connector in Step 5 confirmed its connection the same way.

The Details of LOCAL dialog after pressing TEST, with a green tick on the TEST button, a green tick in the Ftp Server Results panel and the connection trace beside it

The panel holds the whole exchange with the server, several hundred lines long: the connection, the key exchange and the sign-in, each block ending in Success. Scroll to read it. If a block does not end in Success., fix the details before you go any further. The trace names what failed; a later error inside a running integration will not.

TEST uses the details on screen, not the saved ones, so you can try a change before you save it. Press the green tick at the bottom right to save the record, or the red cross to leave it as it was.

Design > Transform Setup

  1. Return to Design, load the integration, and press the Transform Setup tab.
  2. Open the Tasks group in the palette and drag an FTP task onto the design surface, to the right of the CSV Writer.
  3. Drag a Connector from the Transforms group and join the writer to it.
  4. Save the integration.

    The design surface with an FTP task added after the CSV Writer at the end of the order row

FTP Task > Setup

Double click the task to open it.

  1. Transform Id
    • Identifies the transform in the audit report, in its Process Id column. A new task is named FTP.
    • For training, enter: FTPUPLOAD
  2. FTP System
    • The server defined above, listed by its description.
    • For training, select: Local SSH
  3. Action
    • What to do: Upload, Download, Delete Remote File or Delete Remote Folder.
    • For training, select: Upload
  4. File System
    • The local file system to read the file from or write it to: the ordinary Windows file system, or Azure Blob storage.
    • For training, leave as: Windows
  5. Local Directory
    • The folder holding the file to upload.
    • For training, enter: C:\IMan\OutputData
  6. Local File
    • The file, or files. This step needs a wildcard: Step 9 put the run date in the file name, so there is no single name to give.
    • For training, enter: OrderStatus*.csv
  7. Remote Directory
    • The folder on the server to upload into, relative to the folder the account starts in when it signs in.
    • For training, enter: /
  8. Remote File
    • The name to give the file on the server. Leave it blank to keep the local name. That is almost always right when the local name carries a date.
    • For training: leave blank
  9. Delete File from Server
    • Only applies to Download.

The FTP task's Setup tab with Transform Id FTPUPLOAD, FTP System Local SSH, Action Upload, the local folder and the OrderStatus wildcard filled in

Action arrives set to Download

A new task's Action is Download. If you leave the default, the task downloads instead of uploading, and reports no error.

Running it

Press Refresh, then press the TRACE tab in the preview pane. Like the setup screen's test, the trace records the exchange with the server, this time for the transfer itself. It has one block per operation: connect, authenticate, initialise SFTP, open the remote directory, and then one UploadBd block per file sent.

Scroll to the last of them:

UploadBd:
  uploadFileFromDb:
    remoteFilePath: /OrderStatus20260817.csv
    ...
    writeDataSource:
      startingOffset: 0
      server_max_packet_size: 65536
      uploadChunkSize: 32000
      End of data stream...
      ------------------------------------------------
      totalNumBytesSent: 103
    ...
  --uploadFileFromDb
  Success.
--UploadBd

remoteFilePath is where the file landed. totalNumBytesSent is how much of it arrived: 103 bytes, the size of the file Step 9 wrote. Success. closes the block. It is the server's acknowledgement of the write, so you do not need to open an FTP client to confirm it.

A wildcard uploads every file it matches, not just today's

There is one UploadBd block per file the wildcard matched. OrderStatus*.csv matches every status file in the folder, not just today's. If status files have been building up in the folder since last month, every run uploads all of them.

Close the task and save the integration.

Step 11: Simple File Archiving >