NOFILE
NOFILE
A simple class to assist with handling PHP file uploads
check_upload_attempted(string $name, string $subfield) : bool
Check if a file has been uploaded with the specified field name.
If specified in the constructor a prefix will be prepended to this name for comparison. This method will not set any of the error members in the object.
string | $name | The field name |
string | $subfield | Assume that the prefix+field name represent an array |
check_upload(string $name, string $subfield, bool $checkdir) : bool
Check if a file has been uploaded to the specified name, and if it is valid.
If specified in the constructor a prefix will be prepended to this name for comparison. This method will set internal error strings and numbers on failure.
string | $name | The upload key name |
string | $subfield | Assume that the prefix+field name represent an array |
bool | $checkdir | Test if the destination directory exists, and is writable. |
True on success, false on error.
handle_upload(string $name, string $destfilename, string $subfield) : bool
Handle preprocessing an uploaded file, test for errors and move the file to its destination location.
string | $name | The upload key name |
string | $destfilename | An optional destination filename. |
string | $subfield | Assume that the prefix+field name represent an array |
True on success, false on error.
preprocess_upload(array $fileinfo) : string
Preprocess the uploaded file.
If a preprocessor has been passed into this object, this method will preprocess the file
array | $fileinfo | The file info record (from the $_FILES array) for the file to preprocess. |
The filename of the pre-processed file on success. Otherwise, FALSE