name. Name of file

The field contains the name of file. Object of class
file has field name if a visitor has uploaded the file through form field <input type=file>. Constructor file::load may also provide an alternative name of file.

size. Size of file

The field contains size of file in bytes.

text. Text of file

The field contains text of file. By using this field, one can output the content of text files or text resulted from
file::cgi and file::exec.
Note: automatic end of lines (EOL) normalization is made for text files (mode=text), but not for binary files (mode=binary). For normalizing EOL characters in binary files, that come from form for example, you have to use the following code:

Information about file
$some_file.size-size of file in bytes;
$some_file.cdate-creation date;
$some_file.mdate-modification date;
$some_file.adate-last access date.

These fields available if object was created within constructor
file::stat or file::load by loading local file   [3.3.0].

stderr. Standard error text of program execution

file::cgi and file::exec here goes text from standard error program stream.

status. Status of getting this file

file::cgi and file::exec in status field one can find status of program execution (success=0).
file::load from HTTP-server here is status of HTTP request (success=200).

mode. File's mode.   [3.4.0]

Could be text or binary.

content-type. MIME-type of file

The field may contain file's MIME-type. If a cgi-script is executed (see
file::cgi) MIME-type may be specified by the script-in header "content-type". If a file is loaded (see file::load) or its status is retrieved (see file::stat) MIME-type will be defined with the help of table $MAIN:MIME-TYPES (see "Configuration method"), If file extension cannot be located in the table, MIME-type will be defined as "application/octet-stream."

HTTP response headers

If a file was loaded from an HTTP-server, HTTP response headers will be accessible in UPPERCASE as fields of object of class


For example:

If one response header occurs in a response several times, all its values are accessible in
tables field:

table of values with sole column value]

    $key=^{$value.value}[|]<br />

Copyright © 1997–2021 Art. Lebedev Studio | Last updated: 08.10.2012