public function actionUpload() { $folder = $this->folder(); $this->_prepairJson(); $folder = $_SERVER['DOCUMENT_ROOT'] . $folder; Yii::import("ext.EAjaxUpload.qqFileUploader"); //chmod($folder, 0777); // !-----------------------------DeBuG oNlY !!----------------------------------------- $folder = $folder . 'temp/'; //chmod($folder, 0777); // !-----------------------------DeBuG oNlY !!----------------------------------------- $config['allowedExtensions'] = array('jpg', 'jpeg', 'png', 'gif', 'txt', 'doc', 'docx'); $config['disAllowedExtensions'] = array("exe, php"); $sizeLimit = 10 * 1024 * 1024; $pi = pathinfo($_GET['qqfile']); $_GET['qqfile'] = $pi['filename'] . '_' . $_GET['id'] . '.' . $pi['extension']; $uploader = new qqFileUploader($config, $sizeLimit); $this->result = $uploader->handleUpload($folder, true); if ($this->result['success']) { $part = ZakazParts::model()->findByPk($_GET['id']); if (!User::model()->isManager()) { EventHelper::partDone($_GET['proj_id'], $part->title); } } chmod($folder . $_GET['qqfile'], 0666); if (User::model()->isManager() || User::model()->isAdmin()) { $this->_file_data['part_id'] = $_GET['id']; $this->_file_data['orig_name'] = $pi['filename'] . '.' . $pi['extension']; $this->_file_data['id'] = 0; $this->_file_data['req'] = 1; $this->actionApiApprove(); } //$this->result['html']='=)';//'<li>!!!<a href="' . $this->result['file_name'] . '" id="parts_file">' . $_GET['qqfile'] . '</a></li>'; $this->result = array('test' => $this->result['error']); $this->_response->setData($this->result); $this->_response->send(); }