// define the event method $this->upload->setAjaxEvent(); $this->upload->onChange("onUpload");
$this->render = $this->upload; }
public function onUpload($sender) { // check the file is correctly uploaded if ($this->upload->checkMimeType() && $this->upload->checkFileSize()) { alert("File ".$this->upload->getFileName()." (". $this->upload->getFileSize().") uploaded !"); } else if ($this->upload->isEmptyFile()) { alert("Your file is empty !"); } else if (!$this->upload->checkFileSize()) { alert("Your file is too big !"); } else { alert("Mime type ".$this->upload->getFileMimeType(). " not supported !"); } } } ?>