Yii::$app->response->format = \yii\web\Response::FORMAT_RAW; //$headers = Yii::$app->response->headers; header("Content-type: image/jpeg"); Yii::$app->resizeimage->Show(); Yii::$app->resizeimage->Destroy(); } public function actionView($id_file='', $filename=''){ $path = pathinfo($filename); $content = file_get_contents(Yii::$app->params['folder_upload_items'][0].$id_file.'.jmc'); Yii::$app->response->format = \yii\web\Response::FORMAT_RAW; header("Content-type: image/{$path['extension']}"); echo($content); } public function actionImages($filename=''){ $path = pathinfo($filename); $content = file_get_contents(Yii::$app->params['folder_upload_items'][1].$filename); Yii::$app->response->format = \yii\web\Response::FORMAT_RAW;
Yii::$app->resizeimage->Show(); Yii::$app->resizeimage->Destroy(); } public function actionView($id_file='', $filename=''){ $path = pathinfo($filename); $content = file_get_contents(Yii::$app->params['folder_upload_items'][0].$id_file.'.jmc'); Yii::$app->response->format = \yii\web\Response::FORMAT_RAW; header("Content-type: image/{$path['extension']}"); echo($content); } public function actionImages($filename=''){
$args = $this->controller->bindActionParams($this, $params); Yii::trace('Running action: ' . get_class($this->controller) . '::' . $this->actionMethod . '()', __METHOD__); if (Yii::$app->requestedParams === null) { Yii::$app->requestedParams = $args; } return call_user_func_array([$this->controller, $this->actionMethod], $args); } }
} $result = null; if ($runAction && $this->beforeAction($action)) { // run the action $result = $action->runWithParams($params); $result = $this->afterAction($action, $result); // call afterAction on modules foreach ($modules as $module) { /* @var $module Module */
$parts = $this->createController($route); if (is_array($parts)) { /* @var $controller Controller */ list($controller, $actionID) = $parts; $oldController = Yii::$app->controller; Yii::$app->controller = $controller; $result = $controller->runAction($actionID, $params); Yii::$app->controller = $oldController; return $result; } else { $id = $this->getUniqueId(); throw new InvalidRouteException('Unable to resolve the request "' . ($id === '' ? $route : $id . '/' . $route) . '".');
$params = $this->catchAll; unset($params[0]); } try { Yii::trace("Route requested: '$route'", __METHOD__); $this->requestedRoute = $route; $result = $this->runAction($route, $params); if ($result instanceof Response) { return $result; } else { $response = $this->getResponse(); if ($result !== null) { $response->data = $result;
try { $this->state = self::STATE_BEFORE_REQUEST; $this->trigger(self::EVENT_BEFORE_REQUEST); $this->state = self::STATE_HANDLING_REQUEST; $response = $this->handleRequest($this->getRequest()); $this->state = self::STATE_AFTER_REQUEST; $this->trigger(self::EVENT_AFTER_REQUEST); $this->state = self::STATE_SENDING_RESPONSE; $response->send();
require(__DIR__ . '/../common/config/main-local.php'), require(__DIR__ . '/config/main.php'), require(__DIR__ . '/config/main-local.php') ); $application = new yii\web\Application($config); $application->run();
$_GET = [ 'id_file' => '1732', 'filename' => '20210819_100916.jpg', ]; $_SERVER = [ 'TZ' => 'Asia/Jakarta', 'REDIRECT_REDIRECT_REDIRECT_UNIQUE_ID' => 'Zga4_qpMNTo_RjcXgMN7bwAAAMg', 'REDIRECT_REDIRECT_REDIRECT_HTTPS' => 'on', 'REDIRECT_REDIRECT_REDIRECT_SSL_TLS_SNI' => 'dinkes.jogjaprov.go.id', 'REDIRECT_REDIRECT_REDIRECT_STATUS' => '200', 'REDIRECT_REDIRECT_UNIQUE_ID' => 'Zga4_qpMNTo_RjcXgMN7bwAAAMg', 'REDIRECT_REDIRECT_HTTPS' => 'on', 'REDIRECT_REDIRECT_SSL_TLS_SNI' => 'dinkes.jogjaprov.go.id', 'REDIRECT_REDIRECT_STATUS' => '200', 'REDIRECT_UNIQUE_ID' => 'Zga4_qpMNTo_RjcXgMN7bwAAAMg', 'REDIRECT_HTTPS' => 'on', 'REDIRECT_SSL_TLS_SNI' => 'dinkes.jogjaprov.go.id', 'REDIRECT_HANDLER' => 'application/x-httpd-ea-php56', 'REDIRECT_STATUS' => '200', 'UNIQUE_ID' => 'Zga4_qpMNTo_RjcXgMN7bwAAAMg', 'HTTPS' => 'on', 'SSL_TLS_SNI' => 'dinkes.jogjaprov.go.id', 'HTTP_ACCEPT' => '*/*', 'HTTP_USER_AGENT' => 'claudebot', 'HTTP_REFERER' => 'http://dinkes.jogjaprov.go.id/view_image/view/1732/20210819_100916.jpg', 'HTTP_HOST' => 'dinkes.jogjaprov.go.id', 'PATH' => '/usr/local/jdk/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/X11R6/bin:/root/bin:/opt/bin', 'SERVER_SIGNATURE' => '', 'SERVER_SOFTWARE' => 'Apache', 'SERVER_NAME' => 'dinkes.jogjaprov.go.id', 'SERVER_ADDR' => '103.255.15.93', 'SERVER_PORT' => '443', 'REMOTE_ADDR' => '3.236.64.8', 'DOCUMENT_ROOT' => '/home/dinkesjogjaprovg/public_html', 'REQUEST_SCHEME' => 'https', 'CONTEXT_PREFIX' => '/cgi-sys', 'CONTEXT_DOCUMENT_ROOT' => '/usr/local/cpanel/cgi-sys/', 'SERVER_ADMIN' => 'webmaster@dinkes.jogjaprov.go.id', 'SCRIPT_FILENAME' => '/home/dinkesjogjaprovg/public_html/frontend/index.php', 'REMOTE_PORT' => '40486', 'REDIRECT_URL' => '/frontend/index.php', 'GATEWAY_INTERFACE' => 'CGI/1.1', 'SERVER_PROTOCOL' => 'HTTP/1.1', 'REQUEST_METHOD' => 'GET', 'QUERY_STRING' => '', 'REQUEST_URI' => '/view_image/view/1732/20210819_100916.jpg', 'SCRIPT_NAME' => '/frontend/index.php', 'ORIG_SCRIPT_FILENAME' => '/usr/local/cpanel/cgi-sys/ea-php56', 'ORIG_PATH_INFO' => '/frontend/index.php', 'ORIG_PATH_TRANSLATED' => '/home/dinkesjogjaprovg/public_html/frontend/index.php', 'ORIG_SCRIPT_NAME' => '/cgi-sys/ea-php56', 'PHP_SELF' => '/frontend/index.php', 'REQUEST_TIME_FLOAT' => 1711716606.7764799594879150390625, 'REQUEST_TIME' => 1711716606, 'argv' => [], 'argc' => 0, ];