Previous | Next

GetFileSegmentInfo Method

Retrieves the information for the specified file segment.

String GetFileSegmentInfo(
     Long fileId,
     Long segmentIndex,
     Integer field
)

Parameters

fileId
Type: Long
The ID of the file for which the information is to be retrieved. The valid file IDs are values returned from the AddFile method.

segmentIndex
Type: Long
The segment index of the file specified with the fileId parameter for which the information is to be retrieved. The segmentIndex values are 0-based, meaning the first segment of the specified file has the segmentIndex value of 0.

field
Type: Integer
The type of information to retrieve:

  • 0 - Segment start position in a file
  • 1 - Segment size (in bytes)
  • 2 - Segment downloaded size (in bytes)

Return Value

Type: String

If the method succeeds, the return value is the file segment information specified with the field parameter. If the method fails, the return value is "-2". To get extended error information, call GetLastError and GetLastErrorDesc methods.