/var/www/html/multigroup/protected/components/Uploader.php(56)
44 { 45 $this->model = Models::model()->find('class_name = ?', array($className)); 46 $this->filesDir = UploaderConfig::get()->filesDir; 47 $this->imagesDir = UploaderConfig::get()->imgDir; 48 $this->fileTypes = UploaderConfig::$fileTypes; 49 $this->fileAssociations = UploaderConfig::$fileAssociations; 50 } 51 52 public static function processDownload($file) 53 { 54 if (!$file) return false; 55 // данные 56 $fileSize = filesize(UploaderConfig::get()->filesDir.'/'.$file->imageFile); 57 $filemtime = filemtime(UploaderConfig::get()->filesDir.'/'.$file->imageFile); 58 59 // заголовки 60 header($_SERVER["SERVER_PROTOCOL"] . ' 200 OK');// Отправляем требуемые заголовки 61 header('Last-Modified: ' . gmdate('r', $filemtime)); 62 header("Accept-Ranges: bytes"); //Указываем что размер файла будет в байтах 63 header("Content-Length: ".$fileSize); //Передаём размер 64 header("Content-Type: application/force-download"); 65 header('Connection: close'); 66 header("Content-Disposition: attachment; filename=\"".iconv('utf-8','windows-1251',$file->originalName)."\""); 67 68 // отправка
#0 |
+
–
/var/www/html/multigroup/protected/components/Uploader.php(56): filesize("/var/www/html/multigroup/files/gr_demyansk_solyanka/b6dc8a61441d...") 51 52 public static function processDownload($file) 53 { 54 if (!$file) return false; 55 // данные 56 $fileSize = filesize(UploaderConfig::get()->filesDir.'/'.$file->imageFile); 57 $filemtime = filemtime(UploaderConfig::get()->filesDir.'/'.$file->imageFile); 58 59 // заголовки 60 header($_SERVER["SERVER_PROTOCOL"] . ' 200 OK');// Отправляем требуемые заголовки 61 header('Last-Modified: ' . gmdate('r', $filemtime)); |
#1 |
+
–
/var/www/html/multigroup/protected/controllers/FileController.php(21): Uploader::processDownload(File) 16 $file = File::model()->find('id=?', array($this->activeID)); 17 if (!$file) 18 { 19 $this->render('/alert/error-message', array('message'=>'Файл не найден')); 20 } 21 Uploader::processDownload($file); 22 } 23 24 public function actionRefList() 25 { 26 // сюда мы никогда не должны попасть |
#2 |
+
–
/var/www/html/yiiframework/web/actions/CInlineAction.php(50): FileController->actionDownload() 45 $controller=$this->getController(); 46 $method=new ReflectionMethod($controller, $methodName); 47 if($method->getNumberOfParameters()>0) 48 return $this->runWithParamsInternal($controller, $method, $params); 49 else 50 return $controller->$methodName(); 51 } 52 53 } |
#3 |
+
–
/var/www/html/yiiframework/web/CController.php(309): CInlineAction->runWithParams(array("id" => "518")) 304 { 305 $priorAction=$this->_action; 306 $this->_action=$action; 307 if($this->beforeAction($action)) 308 { 309 if($action->runWithParams($this->getActionParams())===false) 310 $this->invalidActionParams($action); 311 else 312 $this->afterAction($action); 313 } 314 $this->_action=$priorAction; |
#4 |
+
–
/var/www/html/yiiframework/web/CController.php(287): CController->runAction(CInlineAction) 282 * @see runAction 283 */ 284 public function runActionWithFilters($action,$filters) 285 { 286 if(empty($filters)) 287 $this->runAction($action); 288 else 289 { 290 $priorAction=$this->_action; 291 $this->_action=$action; 292 CFilterChain::create($this,$action,$filters)->run(); |
#5 |
+
–
/var/www/html/yiiframework/web/CController.php(266): CController->runActionWithFilters(CInlineAction, array()) 261 { 262 if(($parent=$this->getModule())===null) 263 $parent=Yii::app(); 264 if($parent->beforeControllerAction($this,$action)) 265 { 266 $this->runActionWithFilters($action,$this->filters()); 267 $parent->afterControllerAction($this,$action); 268 } 269 } 270 else 271 $this->missingAction($actionID); |
#6 |
+
–
/var/www/html/yiiframework/web/CWebApplication.php(283): CController->run("download") 278 { 279 list($controller,$actionID)=$ca; 280 $oldController=$this->_controller; 281 $this->_controller=$controller; 282 $controller->init(); 283 $controller->run($actionID); 284 $this->_controller=$oldController; 285 } 286 else 287 throw new CHttpException(404,Yii::t('yii','Unable to resolve the request "{route}".', 288 array('{route}'=>$route===''?$this->defaultController:$route))); |
#7 |
+
–
/var/www/html/yiiframework/web/CWebApplication.php(142): CWebApplication->runController("file/download") 137 foreach(array_splice($this->catchAllRequest,1) as $name=>$value) 138 $_GET[$name]=$value; 139 } 140 else 141 $route=$this->getUrlManager()->parseUrl($this->getRequest()); 142 $this->runController($route); 143 } 144 145 /** 146 * Registers the core application components. 147 * This method overrides the parent implementation by registering additional core components. |
#8 |
+
–
/var/www/html/yiiframework/base/CApplication.php(162): CWebApplication->processRequest() 157 */ 158 public function run() 159 { 160 if($this->hasEventHandler('onBeginRequest')) 161 $this->onBeginRequest(new CEvent($this)); 162 $this->processRequest(); 163 if($this->hasEventHandler('onEndRequest')) 164 $this->onEndRequest(new CEvent($this)); 165 } 166 167 /** |
#9 |
+
–
/var/www/html/multigroup/index.php(15): CApplication->run() 10 defined('YII_DEBUG') or define('YII_DEBUG',true); 11 // specify how many levels of call stack should be shown in each log message 12 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3); 13 14 require_once($yii); 15 Yii::createWebApplication($config)->run(); |