fileuploadFileupload class.
This is a class for handling file uploads. It assumes that one or more files have been uploaded and are being actioned by the current Php script which instantiates this object.
Located in /file-defs.php (line 674)
mixed
$allowed_types
(line 686)
Array of allowed mimetypes (unset = any types)
mixed
$destination_dir
= "." (line 682)
Destination dir to put files
mixed
$errcode
= UPLOAD_E_OK (line 698)
Error code. Check to see if error occurred.
mixed
$errmsg
= array() (line 700)
Error message array, goes with errcode.
mixed
$fieldname
= "" (line 688)
Upload field name
mixed
$filename
= "" (line 690)
Original filename
mixed
$filepath
= "" (line 696)
Upload path to the file on the server
mixed
$filesize
= 0 (line 694)
Physical size of the file (bytes)
mixed
$hasfiles
= false (line 680)
True if some files were uploaded
mixed
$max_size
= 0 (line 684)
Max filesize, else delete (0 = any size)
mixed
$mimetype
= "" (line 692)
Mime type of the the file
mixed
$uploaded
(line 676)
Array of info on uploaded files
mixed
$uploaded_count
= 0 (line 678)
No. of files uploaded
Constructor. On instantiation this class checks the global variable space for uploaded file info and pre-processes it.
NB: You may specify a filesize limit with $maxsize. If you do then we do not take notice of the MAX_FILE_SIZE submitted from the form. This is recommended, since the form value can easily be hacked..
Acquire the details on the current upload file. This includes the
original filename, its mimetype, its size and the full path on the webserver to which the file was uploaded. The details are populated in class variables: $this->fieldname $this->filename $this->mimetype $this->filesize $this->filepath And these variables are then available to be read/used by the calling application code.
Get details on the last file which was uploaded. If there are no more, then this function returns false.
Get details on the next file which was uploaded. If there are no more, then this function returns false.
Get details on the previous file which was uploaded. If there are no more, then this function returns false.
Set the allowed list of filetypes. This is specified as a comma-delimited list, and replaces any already defined.
Set the maximum filesize allowed
Store the current upload file. Optionally specify a destination dir, and a filename. This is useful if you want to process each file separately, and need to store the uploaded file in a particular place.
Store all files away at destination dir. We use the original names by default.
Documentation generated by phpDocumentor 1.3.0RC3