Previous | Next

GetFileInfo Method

Retrieves the information for the specified file.

String GetFileInfo(
     Long fileId,
     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.

field
Type: Integer
The type of information to retrieve:

  • 0 - URL
  • 1 - Redirected URL
  • 2 - Status (Possible values returned: "0" - Added, "1" - Downloading, "2" - Completed)
  • 3 - File size (in bytes)
  • 4 - Downloaded size (in bytes)
  • 5 - Downloaded time
  • 6 - Remain size (in bytes)
  • 7 - Remain time
  • 8 - Rate (in KB/s)
  • 9 - Number of file segments
  • 10 - Requested number of file segments
  • 11 - Save path
  • 12 - Referer
  • 13 - User name
  • 14 - Password
  • 15 - Display File Name
  • 16 - File Count (fileId parameter is ignored)

Return Value

Type: String

If the method succeeds, the return value is the file 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.