/** * @see \wcf\page\IPage::readData() */ public function readData() { parent::readData(); // get file data if ($this->tiny) { $mimeType = $this->attachment->tinyThumbnailType; $filesize = $this->attachment->tinyThumbnailSize; $location = $this->attachment->getTinyThumbnailLocation(); } else { if ($this->thumbnail) { $mimeType = $this->attachment->thumbnailType; $filesize = $this->attachment->thumbnailSize; $location = $this->attachment->getThumbnailLocation(); } else { $mimeType = $this->attachment->fileType; $filesize = $this->attachment->filesize; $location = $this->attachment->getLocation(); } } // init file reader $this->fileReader = new FileReader($location, array('filename' => $this->attachment->filename, 'mimeType' => $mimeType, 'filesize' => $filesize, 'showInline' => in_array($mimeType, self::$inlineMimeTypes), 'enableRangeSupport' => !$this->tiny && !$this->thumbnail, 'lastModificationTime' => $this->attachment->uploadTime, 'expirationDate' => TIME_NOW + 31536000, 'maxAge' => 31536000)); // add etag for non-thumbnail if (!$this->thumbnail && !$this->tiny) { $this->fileReader->addHeader('ETag', '"' . $this->attachmentID . '"'); } }
/** * @see \wcf\page\IPage::readData() */ public function readData() { parent::readData(); // get file data $mimeType = $this->file->fileType; $filesize = $this->file->filesize; $location = $this->file->getLocation(); // init file reader $this->fileReader = new FileReader($location, array('filename' => $this->file->filename, 'mimeType' => $mimeType, 'filesize' => $filesize, 'showInline' => in_array($mimeType, self::$inlineMimeTypes), 'enableRangeSupport' => true, 'lastModificationTime' => $this->file->uploadTime, 'expirationDate' => TIME_NOW + 31536000, 'maxAge' => 31536000)); // add etag $this->fileReader->addHeader('ETag', '"' . $this->fileID . "'"); }