public function show() { if (false === empty($this->output)) { $path = $this->fileinf; if ($path !== false) { File::output($path, $this->chunk, $this->delay); } else { echo $this->output; } } if ($this->clean) { $this->fileinf = false; $this->output = null; App::off('ready', array($this, 'show')); } }
public function show() { File::output($this->cacheName, 1024); }
public function show() { if (filesize($this->cacheName) > 524287) { File::output($this->cacheName); } else { readfile($this->cacheName); } }
/** * attachmentで出力する * @param File $file 出力するファイル */ public static function attach(File $file) { Log::disable_display(); if (is_file($file->fullname()) || $file->value() !== null) { if ($file->update() > 0) { if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && $file->update() <= strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE'])) { self::status_header(304); exit; } header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $file->update()) . ' GMT'); } header(sprintf('Content-Type: ' . $file->mime() . '; name=%s', $file->name())); header(sprintf('Content-Disposition: attachment; filename=%s', $file->name())); if ($file->size() > 0) { header(sprintf('Content-length: %u', $file->size())); } $file->output(); } self::status_header(404); exit; }
/** * attachmentで出力する * @param File $file * @param string $contentType */ public static function attach(File $file, $contentType = "") { if (empty($contentType)) { $contentType = "application/octet-stream"; } header(sprintf("Content-Type: " . $contentType . "; name=%s", $file->name())); header(sprintf("Content-Disposition: attachment; filename=%s", $file->name())); if ($file->size() > 0) { header(sprintf("Content-length: %u", $file->size())); } $file->output(); }