IPWorks EDI 2020 Node.js Edition

Questions / Feedback?

SendFile Method

Send the specified file to the server.

Syntax

oftpclient.sendFile(localFile, virtualFileName, [callback])

Callback

The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).

The callback for this method is defined as:

function(err){ }

'err' is the error that occurred. If there was no error, then 'err' is 'null'.

'err' has 2 properties which hold detailed information:

err.code
err.message

Remarks

This method connects to the server, and uploads the specified file to the server. The LocalFile parameter contains the path and name of the file to send to the server. The VirtualFileName parameter contains the virtual file name of the file being sent. If this parameter is left as an empty string, the component will use the filename contained in the LocalFile parameter by default.

Note: When SetUploadStream has been called with a valid input stream, the data will be uploaded from there instead of the LocalFile.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks EDI 2020 Node.js Edition - Version 20.0 [Build 8203]