title: Laravel Downloaded file from the browser gets corrupted
body: <p>I am trying to download the file saved in s3. So I have codes like below.</p>
  
  <pre><code>static public function download($key, $disk = 's3') : object
  {
  
      $file = FileHelper::get($key);
  
      $local = Storage::disk('local');
      $local-&gt;put(basename($key), $file);
      $pathToFile = storage_path().'/app/'.basename($key);
  
      $headers = [
          'Content-Type' =&gt; \GuzzleHttp\Psr7\mimetype_from_filename(basename($key)),
          'Content-Description' =&gt; 'File Transfer',
          'Content-Disposition' =&gt; "attachment; filename=' ". basename($key),
          'filename'=&gt; basename($key)
      ];
  
      $repsonse = response()-&gt;download($pathToFile, basename($key), $headers)-&gt;deleteFileAfterSend(true);
      ob_end_clean();
  
      return $repsonse;
  }
  </code></pre>
  
  <p>And I have the javascript code like below.</p>
  
  <pre><code>downloadFile() {
              var app = this;
  
              var url = baseRoute + 'files/' + this.fileId + '/download';
              axios.get(url, {
                  headers: {
                      Authorization: 'bearer ' + this.Authentication.tokenData().token,
                      responseType : "blob"
                  }
              }).then(function (response) {
  
                  var today = ((new Date()).toISOString()).slice(2,10),
                      filename = today.replace(/-/gi, "")+' '+ app.fileTitle;
  
                  let blob = new Blob([response.data], {
                      type: response.headers['content-type']
                  });
  
                  let link = document.createElement('a');
                  link.href = window.URL.createObjectURL(blob);
                  link.download = filename;
                  link.click();
  
              }).catch(function (response) {
                  console.log(response);
              });
          }
  </code></pre>
  
  <p>The file is downloaded, however, the file is corrupted. (it would not open) I checked S3 bucket to see if the file is corrupted during upload, but it was fine there. </p>
  
  <p>What am I doing wrong? Any advice or suggestion would be appreciated.</p>
  
  <p>Thank you in advance.</p>
  
  <p><strong>Added: when I tried to view the image, it returned white squared which means its base64 encoded image. Does it have to do with being empty file?</strong></p>