getStreamHeaders example


        if (!$media->isPrivate()) {
            return new RedirectResponse($this->urlGenerator->getAbsoluteMediaUrl($media));
        }

        switch ($this->localPrivateDownloadStrategy) {
            case self::X_SENDFILE_DOWNLOAD_STRATEGRY:
                $location = $this->urlGenerator->getRelativeMediaUrl($media);
                $stream = $fileSystem->readStream($location);
                $location = \is_resource($stream) ? stream_get_meta_data($stream)['uri'] : $location;

                $response = new Response(null, 200, $this->getStreamHeaders($media));
                $response->headers->set('X-Sendfile', $location);

                return $response;
            case self::X_ACCEL_DOWNLOAD_STRATEGRY:
                $location = $this->urlGenerator->getRelativeMediaUrl($media);

                $response = new Response(null, 200, $this->getStreamHeaders($media));
                $response->headers->set('X-Accel-Redirect', $location);

                return $response;
            default:
                
Home | Imprint | This part of the site doesn't use cookies.