title: symfony downloading video from url
body: <p>I’m trying to download a video from an extrernal URL using symfony. So i have this route, if i click on it directly in the browser, I receive two possible answers: the video is played or (if the browser is unable to reproduce it), the video is downloaded from this external URL. What i’m trying to create is a response from the Controller to always download the video. I’ve tried several solution with no luck.</p>
  
  <p>Some tried solutions:</p>
  
  <pre><code>$response = new BinaryFileResponse($url);
  $response-&gt;setContentDisposition(ResponseHeaderBag::DISPOSITION_ATTACHMENT);
  
  return $response;
  </code></pre>
  
  <p>Since it’s not a static file is failing.</p>
  
  <p>Also tried</p>
  
  <pre><code>$response = new RedirectResponse($url);
  $response-&gt;headers-&gt;set('Content-Type', 'video');
  $d = $response-&gt;headers-&gt;makeDisposition(
  ResponseHeaderBag::DISPOSITION_ATTACHMENT,
  $videoUrl
  );
  $response-&gt;headers-&gt;set('Content-Disposition', $d);
  </code></pre>
  
  <p>And of course the ‘StreamedResponse’… I'm assuming this is possible since i'm getting the desired behavior when the format is not properly traduced in the browser... Any help is appreciated.</p>