Skip to content

Step 10 – FTP Upload

Step 9 wrote a file listing what Sage 300 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 send it to that system.

There are two parts, as in step 5:

  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 and then choose it by name in any FTP task. The credentials are kept in one place, not 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. You cannot change it after you save the record.
    • For training: LOCAL
  2. Description
    • The FTP task lists servers by description, not by id, so 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.
  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, port 22, the username and a masked password

FTP or SFTP?

Use SFTP, the SSH option. It encrypts the credentials and the file, and it needs one port where FTP needs two (control and data). Most servers now expect it. This training uses it.

Testing the connection

Press TEST. A tick on the button and a second one in the Ftp Server Results panel beside the form confirm that IMan reached the server and signed in. The System Connector in step 5 confirmed its test 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 of it, and scrolls. It shows the connection, the key exchange, the sign-in and the SFTP session, and each block ends in Success. If a block does not, fix the details before you go further. The trace names what failed. A later error in a running integration will not.

TEST uses the values 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 branch

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. It arrives called 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 that IMan reads the file from or writes it to: Windows 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. Use a wildcard here. 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. When the local name carries a date, that is almost always what you want.
    • For training, leave blank.
  9. Delete File from Server
    • Applies only to Download. It is disabled for every other action.

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

Action arrives set to Download. If you leave the default, the task downloads instead of uploading.

Running it

Press Refresh. Everything upstream runs, so the writer produces the file again before the task sends it. As in step 9, another three orders go into Sage 300 each time.

Then press the TRACE tab on the preview side. It shows the same kind of exchange as the setup screen's test, this time for the transfer:

The TRACE tab showing the upload block, with the remote file path, 108 bytes sent and a final Success

remoteFilePath is where the file landed and totalNumBytesSent is how much of it arrived. Success. closes the block. It means the server acknowledged the write, so you do not need to open an FTP client to confirm it.

Close the task and save the integration.

Step 11: Simple File Archiving >