} $zip->close(); $tai_anh = new TaiAnhSanPham(); $tai_anh->file = $zipname; $tai_anh->save(); header('Content-Type: application/zip'); header('Content-disposition: attachment; filename='.$zipname); header('Content-Length: ' . filesize($zipname)); // readfile($zipname); ob_clean(); flush(); if (readfile($zipname)) // { // unlink($zipname); // } // unlink($zipname); clearstatcache();
$tai_anh = new TaiAnhSanPham(); $tai_anh->file = $zipname; $tai_anh->save(); header('Content-Type: application/zip'); header('Content-disposition: attachment; filename='.$zipname); header('Content-Length: ' . filesize($zipname)); // readfile($zipname); ob_clean(); flush(); if (readfile($zipname)) // { // unlink($zipname);
} } } if (isset($_GET['attachment'])){ $array = Json::decode(base64_decode($_GET['attachment'])); $this->download($array['objectId']); } $model = $this->findModel($id); $model->updateAttributes(['so_luot_xem'=>$model->so_luot_xem + 1]); $price_range = PriceRange::findAll(['product_id' => $model->id, 'order_type_id' => 1]); // VarDumper::dump($model->priceRange, 10, true); exit;
} /** * Returns all ancestor modules of this controller. * The first module in the array is the outermost one (i.e., the application instance), * while the last is the innermost one. * @return Module[] all ancestor modules that this controller is located within. */ public function getModules() { $modules = [$this->module]; $module = $this->module; while ($module->module !== null) {
require(__DIR__ . '/../vendor/yiisoft/yii2/Yii.php'); $config = require(__DIR__ . '/../config/web.php'); date_default_timezone_set("Asia/Ho_Chi_Minh"); ini_set('max_execution_time', 0); (new yii\web\Application($config))->run();
$_GET = [ 'id' => '948', 'attachment' => 'eyJvYmplY3RJZCI6OTQ4fQ==', ];