title: Laravel 5.7 Storage download CSV file adds a .txt extension
body: <p>In Laravel 5.7 I'm using a simple route to allow a user to download a local stored csv file.</p>
  
  <pre><code>Route::get('download/{file}', function($file) {
              return Storage::disk('s3')-&gt;download($file, $file, ['Content-Type: text/csv"']);
             })-&gt;name('download');
  </code></pre>
  
  <p>And in my Blade template :</p>
  
  <pre><code>&lt;a href="{{ Route('download', ['file' =&gt; 'import.csv']) }}" class="btn btn-primary btn-sm btn-line btn-rect" data-original-title="" title=""&gt; &lt;i class="fa fa-download" aria-hidden="true"&gt;&lt;/i&gt;
  </code></pre>
  
  <p>When user clicks on the link, Laravel is finding import.csv file into s3 disk and allow user to download the file but it adds a .txt extension. So the user is downloading import.csv.txt and this file corresponds to import.csv data.</p>
  
  <p>How can I prevent Laravel to add a .txt extension to the CSV file ? I tried <code>return Storage::disk('s3')-&gt;download($file, $file);</code> and <code>return Storage::disk('s3')-&gt;download($file);</code> and same result each time.</p>
  
  <p><strong>Running environment</strong>: This is a production server running Apache2 with PHP 7.1 under Debian 9.  </p>
  
  <p><strong>EDIT1</strong>: I've made the same test on a fresh Laravel 5.7 install, same issue :</p>
  
  <pre><code>Route::get('/', function () {
  return Storage::disk('public')-&gt;download('import.csv', 'import.csv', ['Content-Type: text/csv"','Content-disposition: attachment;filename=MyVerySpecial.csv']);});
  </code></pre>
  
  <p><strong>EDIT2</strong>: I've added a new test with a controller.
  Route :</p>
  
  <pre><code>Route::get('test', 'test@test');
  </code></pre>
  
  <p>Controller <code>test</code> :</p>
  
  <pre><code>public function test()
  {
    return Storage::disk('public')-&gt;download('import.csv', 'import.csv', ['Content-Type: text/csv"','Content-disposition: attachment;filename=MyVerySpecial.csv']);
  }
  </code></pre>
  
  <p>Exactly the same result</p>
  
  <p><strong>EDIT3</strong>: Tested with headers:</p>
  
  <pre><code>['Content-Type: application/octet-stream"','Content-disposition: attachment;filename="MyVerySpecial.csv"']
  </code></pre>
  
  <p>Same result</p>
  
  <p><strong>EDIT4</strong>: Looks to be a server configuration problem as I have this issue with Firefox (last developer edition) and not with IE</p>
  
  <p>Thank you for your help.</p>
  
  <p><strong>EDIT5</strong>: I think there is something wrong with Laravel because if I'm creating a php file with:</p>
  
  <pre><code>&lt;?php
  $file = "../storage/app/public/import.csv";
  header("Content-Description: File Transfer");
  header("Content-Type: application/octet-stream");
  header("Content-Disposition: attachment; filename=" . basename($file));
  readfile ($file);
  exit();    
  </code></pre>
  
  <p>This is working perfectly with Firefox. But if I use a route like</p>
  
  <pre><code>return Storage::disk('public')-&gt;download('import.csv', 'import.csv', ['Content-Description: File Transfer','Content-Type: application/octet-stream','Content-Disposition: attachment; filename=/home/webadmin/fresh/storage/app/public/import.csv']);
  </code></pre>
  
  <p>Well it does not work.</p>
  
  <p><strong>Question</strong>: has somebody else tried to reproduce same issue?</p>