title: Firefox has problems when downloading with a space in filename
body: <p>It seems that firefox has a problem with spaces within the filename for downloading...</p>
  
  <pre><code>header( 'Content-Type: text/csv' );
  header( 'Content-Disposition: attachment;filename='.$filename);
  $fp = fopen('php://output', 'w');
  fputs($fp, $csvdata);
  fclose($fp);
  </code></pre>
  
  <p>Here is an example of a file named: <code>Test_ Grad Fair 2_20140129_1312_607.csv</code></p>
  
  <p>When I attempt to download the file using the code above with FireFox the following occurs. (the main problem is it removes the file extension!)</p>
  
  <p><img src="https://i.stack.imgur.com/onbTe.jpg" alt="Download Image from Firefox"></p>
  
  <p>And when I try downloading it from Safari, or Chrome:</p>
  
  <p><img src="https://i.stack.imgur.com/tyJVj.png" alt="Downloading it from Safari"></p>
  
  <p>&nbsp;
  &nbsp;</p>
  
  <p>I know a solution would be to maybe do something like:</p>
  
  <pre><code>$filename = str_replace(' ', '', $filename);
  </code></pre>
  
  <p>However, I prefer to figure out why FireFox is having this problem, it seems kinda ridiculous that you can't have a space in a filename. Could this be like a <code>%20</code> instead of a space problem?</p>