title: Some error in file downloading after uploading file to S3 using laravel
body: <p>I have uploaded file to s3. after changing its name and adding a timestamp to name</p>
  
  <p>The same code is working fine on local Linux server. but having issue on aws linux server</p>
  
  <p>Code I have used to download file using streams</p>
  
  <pre><code>    header('Content-Description: File Transfer');
      header('Content-Disposition: attachment; filename='.$fileName);
      header('Content-Transfer-Encoding: binary');
      header('Connection: Keep-Alive');
      header('Expires: 0');
      header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
      header('Pragma: public');
      header('Content-Length: ' . $size);
  
      if (!($stream = fopen($response, 'r'))) {
          throw new \Exception('Could not open stream for reading file: ['.$fileName.']');
      }
      // Check if the stream has more data to read
      while (!feof($stream)) {
          // Read 1024 bytes from the stream
          echo fread($stream, 1024);
      }
      // Be sure to close the stream resource when you're done with it
      fclose($stream);
  </code></pre>
  
  <p>If I have uploaded a jpg image. Then after downloading the same file gives an error.</p>
  
  <p>Error interpreting JPEG image file (Not a JPEG file: starts with 0x0a 0xff)</p>