/** * Return the response headers. * * @param Image $image * @param int $quality * @return Response */ public function generate(Image $image, $quality = 100) { $response = parent::make($image->getImage()); $response->headers->set('Content-Disposition', 'inline'); $response->headers->remove('Content-Length'); $response = $response->setContent($image->encode(null, $quality)); return $response->sendHeaders(); }
/** * Make the response. * * @param FileInterface $file * @return Response */ public function make(FileInterface $file) { $response = parent::make($file); $response->headers->set('Content-disposition', 'attachment; name=' . $file->getName()); $folder = $file->getFolder(); $disk = $folder->getDisk(); return $response->setContent($this->manager->read("{$disk->getSlug()}://{$folder->getSlug()}/{$file->getName()}")); }
/** * Make the response. * * @param FileInterface $file * @return Response */ public function make(FileInterface $file) { $response = parent::make($file); $response->headers->set('Accept-Ranges', 'bytes'); $response->headers->set('Cache-Control', 'no-cache'); // Cache breaks streaming. $this->chunk($response, $file); return $response; }
/** * Make the response. * * @param FileInterface $file * @return Response */ public function make(FileInterface $file) { $response = parent::make($file); $response->headers->set('Content-Disposition', 'inline'); return $response->setContent($this->manager->read($file->location())); }
/** * Make the response. * * @param FileInterface $file * @return Response */ public function make(FileInterface $file) { $response = parent::make($file); $response->headers->set('Content-disposition', 'attachment; filename=' . $file->getName()); return $response->setContent($this->manager->read($file->diskPath())); }