File
final class File (View source)
File wrapper class
Methods
No description
destructor
deletes file if it is temporary, usually from a moved upload file
Gets file content
Gets file content
Whether file is uploaded.
Initializes object from uploaded file.
Loads uploaded file from table change request.
sets the name if the file to the one selected in the tbl_change form
checks the superglobals provided if the tbl_change form is submitted and uses the submitted/selected file
Sets named file to be read from UploadDir.
Checks whether file can be read.
If we are on a server with open_basedir, we must move the file before opening it. The FAQ 1.11 explains how to create the "./tmp" directory - if needed
Sets whether the content should be decompressed before returned
Sets error message for unsupported compression.
Attempts to open the file.
Opens file from zip
Checks whether we've reached end of file
Closes the file
Reads data from file
Returns compression used by file.
Details
__construct(string|null $name = null)
No description
__destruct()
destructor
bool
cleanUp()
deletes file if it is temporary, usually from a moved upload file
string|false
getRawContent()
Gets file content
string|false
getContent()
Gets file content
bool
isUploaded()
Whether file is uploaded.
bool
setUploadedFile(string $name)
Initializes object from uploaded file.
bool
setUploadedFromTblChangeRequest(string $key, string $rownumber)
Loads uploaded file from table change request.
bool
setSelectedFromTblChangeRequest(string $key, string|null $rownumber = null)
sets the name if the file to the one selected in the tbl_change form
Message|null
getError()
Returns possible error message.
bool
checkTblChangeForm(string $key, string $rownumber)
checks the superglobals provided if the tbl_change form is submitted and uses the submitted/selected file
bool
setLocalSelectedFile(string $name)
Sets named file to be read from UploadDir.
bool
isReadable()
Checks whether file can be read.
bool
checkUploadedFile()
If we are on a server with open_basedir, we must move the file before opening it. The FAQ 1.11 explains how to create the "./tmp" directory - if needed
void
setDecompressContent(bool $decompress)
Sets whether the content should be decompressed before returned
void
errorUnsupported()
Sets error message for unsupported compression.
bool
open()
Attempts to open the file.
bool
openZip(string|null $specificEntry = null)
Opens file from zip
bool
eof()
Checks whether we've reached end of file
void
close()
Closes the file
string
read(int $size)
Reads data from file
string
getCompression()
Returns compression used by file.