title: Download Image Laravel Google App Engine
body: <p>I am trying to download image stored in Google Cloud Storage Bucket. I am using following code:</p>
  
  <pre><code>$headers = array(
      'Content-Type'=&gt; 'image/jpeg',
      'Content-Disposition' =&gt; 'attachment; filename=test.jpg',
      'Expires' =&gt; '0',
      'Content-Length' =&gt; filesize($pathToFile),
      'Content-Transfer-Encoding' =&gt; 'binary',
      'Cache-Control' =&gt; 'must-revalidate, post-check=0, pre-check=0',
  );
  
  return Response::download($pathToFile, 'test.jpg', $headers);
  </code></pre>
  
  <p>I checked <code>$pathToFile</code> is good and i am getting a valid filesize. </p>
  
  <p>But I am unable to download file.</p>
  
  <p>I checked App Engine Logs. </p>
  
  <pre><code>appengine.ERROR: exception 'ErrorException' with message
  'fopen(php://output): failed to open stream: Unknown stream type
  php://output.' in
  /base/data/home/apps/s~red-flamingo/1.377568004893744378/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/BinaryFileResponse.php:254
  Stack trace:
  #0 [internal function]: Illuminate\Exception\Handler-&gt;handleError(2, 'fopen(php://out...', '/base/data/home...', 254, Array) 
  #1 /base/data/home/apps/s~red-flamingo/1.377568004893744378/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/BinaryFileResponse.php(254):
  fopen('php://output', 'wb') 
  #2/base/data/home/apps/s~red-flamingo/1.377568004893744378/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Response.php(374):
  Symfony\Component\HttpFoundation\BinaryFileResponse-&gt;sendContent() 
  #3/base/data/home/apps/s~red-flamingo/1.377568004893744378/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(608):
  Symfony\Component\HttpFoundation\Response-&gt;send()
  #4 /base/data/home/apps/s~red-flamingo/1.377568004893744378/public/index.php(49):
  Illuminate\Foundation\Application-&gt;run()  #5 {main} [] []
  </code></pre>