Class CMS_fileUpload
This class manages a file upload onto the server Need to give it at least a path representing the destination of uploaded file and the file input field name concerned (used like: $_FILES[$fieldname])
Intégration sample where "fieldname" is the name of file input field : // File upload management if ($_POST["edit_fieldname"]) { // comes from a radio to force deletion of previous file $o_file_upload = new CMS_fileUpload("fieldname", true); $o_file_upload->setPath('origin', $your_value_of_previous_file); // Delete previous file $o_file_upload->deleteOrigin(); // Proceed to upload if needed if ($_FILES["fieldname"]["name"] && $item->writeToPersistence()) { $o_file_upload->setPath('destination', $your_value_of_destination_path); if (!$o_file_upload->doUpload()) { $cms_message .= "Error message"; } } // Do something with filename on success $your_final_filename = $o_file_upload->getFilename(); }
Located in /automne/classes/files/fileupload.php (line 52)
CMS_grandFather | --CMS_fileUpload
Constructor
Deletes file stored before fileUpload attempts to replace it Return true either file does not exists or file is deleted successfully This method is not called from doUpload(), use it manually first !
Getter for any private attribute on this class
Gets one path filename
Gets an input field value (from $_FILES[$this->_fieldname][$key] Array)
Getter for a path, given its key in $_pathes attribute array
Get one path base directory
Check file size and server max uploading file size
Setter for any private attribute on this class
Set a path, given its key
Check any file as destination path and delete it if $this->_overwrite attribute set to true
Check presence of a file and delete it
Check that given key (key in $_pathes attribute array) is valid
Inherited From CMS_grandFather
CMS_grandFather::autoload()
CMS_grandFather::hasError()
CMS_grandFather::log()
CMS_grandFather::PHPErrorHandler()
CMS_grandFather::raiseError()
CMS_grandFather::setDebug()
CMS_grandFather::setLog()
CMS_grandFather::_raiseError()
CMS_grandFather::__call()
Inherited from CMS_grandFather
CMS_grandFather::ERROR_LOG
CMS_grandFather::SYSTEM_LABEL
Documentation generated on Wed, 15 Feb 2012 15:30:30 +0100 by phpDocumentor 1.4.3