GET_INFO

Get information about the contents of the current file, either before or after the SEND operation.

GET_INFO(Option,StringInfo)

Parameters

Parameter

Type

Direction

Description

Option

String

IN

Information you want to have returned; one of LENGTH, RANGE, TCPSNDBUF, TCPRCVBUF, or DIGEST=Algorithm{,KEY=Key}

StringInfo

String

OUT

Returned information if DIGEST or RANGE are specified in Option

Options

Option

Description

LENGTH

Get the length of the body in $status

DIGEST=Algorithm{,KEY=Key}

Get encoded contents of the HTTP request /response using the specified algorithm and key (if required.) The supported algorithms are MD*, SHA* and HMAC_*.

The digest is returned in HEX encoding, which is always an ASCII string. It will go, for example, first to SHA1, then it will be returned with encoding HEX. To use another encoding, use $decode and $encode.

The maximum length of the Key is 256 bytes.

RANGE

Get the range of bytes used in a Contents-Range header during chunked transfer.

For upload (after LOAD_FILE_CONTENTS), the range will reflect the currently set contents.

For download (after DUMP_FILE_CONTENTS), the range will reflect the expected contents, based on what was already received and the chunk size.

TCPSNDBUF

Get the size of the TCP send buffer used to upload a file or file chunk with LOAD_FILE_CONTENTS.

If the returned value is 0, the default buffer size for the local TCP stack was used.

TCPRCVBUF

Get the size of the TCP received buffer used to download a file or file chunk with DUMP_FILE_CONTENTS.

If the returned value is 0, the default buffer size for the local TCP stack was used.

Return Values

Numeric information is returned through $status and string information is returned through the StringInfo parameter.

Values Returned in $status

Value

Meaning

0

The default buffer size for the local TCP stack was used. The TCPSNDBUF or TCPRCVBUF was not specified in LOAD_FILE_CONTENTS or DUMP_FILE_CONTENTS.

>0

Length of the file contents.

-1

No file for RANGE option

-4

Invalid option in the OptionList

-5

Invalid value for option in the OptionList

-11

A problem occurred with encoding a digest

-12

Internal error occurred

Use

May be called after LOAD_FILE_CONTENTS or DUMP_FILE_CONTENTS, and before or after SEND, depending on the information required.

Description

The GET_INFO operation is most useful when the request body represents the current file, as there is no other way of getting information about the file length or range.

Related Topics