IPWorks EDI 2020 Node.js Edition

Questions / Feedback?

StartByte Property

The byte index in RemoteFile and LocalFile from which to start the transmission.

Syntax

 ftp.getStartByte([callback])
 ftp.setStartByte( startByte, [callback])

Default Value

"0"

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 the getStartByte([callback]) method is defined as:

function(err, data){ }

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

'data' is the value returned by the method.

The callback for the setStartByte([callback]) 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 property contains a zero-based index in both RemoteFile and LocalFile that determines the point where the transmission of data starts from. This is useful for resuming interrupted downloads and uploads of files from FTP servers.

Once set, the StartByte index is used for all future downloads/uploads. The property must be reset to "0" for normal downloads/uploads.

The type of the property is a string instead of numeric to allow for certain implementations that expect an alphanumeric marker of the start index.

In the Transfer event, the TransferredBytes parameter will include the bytes skipped (i.e. it will show StartByte more bytes than actually transferred).

NOTE: some FTP servers may not support the FTP 'REST' command. If that is the case with the server you are accessing, you will not be able to use the StartByte property.

This property is not available at design time.

Data Type

String

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