public function streamDownload($callback, $name = null, array $headers = [], $disposition = 'attachment')
    {
        $response = new StreamedResponse($callback, 200, $headers);

        if (! is_null($name)) {
            $response->headers->set('Content-Disposition', $response->headers->makeDisposition(
                $disposition,
                $name,
                $this->fallbackName($name)
            ));
        }

        return $response;
    }
public function streamDownload($callback, $name = null, array $headers = [], $disposition = 'attachment')
    {
        $response = new StreamedResponse($callback, 200, $headers);

        if (! is_null($name)) {
            $response->headers->set('Content-Disposition', $response->headers->makeDisposition(
                $disposition,
                $name,
                $this->fallbackName($name)
            ));
        }

        return $response;
    }
public function streamDownload ( $ callback , $ name = null , array $ headers = [ ] , $ disposition = 'attachment' ) { $ response = new StreamedResponse ( $ callback , 200 , $ headers ) ; if ( ! is_null ( $ name ) ) { $ response -> headers -> set ( 'Content-Disposition' , $ response -> headers -> makeDisposition ( $ disposition , $ name , $ this -> fallbackName ( $ name ) ) ) ; } return $ response ; }
Create a new streamed response instance as a file download.

@param  \Closure  $callback
@param  string|null  $name
@param  array  $headers
@param  string|null  $disposition
@return \Symfony\Component\HttpFoundation\StreamedResponse
Create a new streamed response instance as a file download .