title: PHP Generate file and promt save as
body: <p><strong>I have a script for generate a .csv file and then download, but I need the dialog "Save as" for the user because I want a fast replace of the old file.</strong></p>
  
  <p>An easy example, I download the file "myFile.csv", then edit the data and download again for the refresh, but I need to REPLACE the file, and the browser download it as "myFile (1).csv", so I need to change the name. The point here, time is crucial.</p>
  
  <p>I want the dialog "Save as" for the force as the same name and replace it.</p>
  
  <p>A MWE:</p>
  
  <pre><code>&lt;?php
  header('Content-Type: text/csv;charset=Windows-1252');
  header('Content-Disposition: inline; filename="myFile.csv";');
  
  $delimiter = ',';
  
  $f = fopen('php://output', 'w');
  
  foreach ($cars as $car) {
      fputcsv($f, [$car['id'],$car['model'],$car['color'],null], $delimiter);
  }
  fclose($f);
  ?&gt;
  </code></pre>
  
  <p><strong>EDIT:</strong> <em>(Aclaration)</em></p>
  
  <p>Tested on Google Chrome 68</p>
  
  <p>I just realized that I did not mention an important point, when selecting the link for the download, <strong>the download automatically starts as myFile (1).csv</strong> and that's what I want to stop, I do not want the automatic download, I want the save dialog, save or cancel.</p>