title: Audio File .wav Corrupted after download with php
body: <p>Regards,</p>
  
  <p>Using CodeIgniter-PHP and I have a Link (Download Audio) which makes the call to my controller that has the function of downloading audio in. Wav.
  As parameter I send the corresponding filename.</p>
  
  <p>Here is my code on my controller:</p>
  
  <pre><code>public function downloadFile($filename) {
          $filepath = base_url().'audiofiles/'.$filename;
          $filesize = filesize($filepath);
          header('Content-Description: File Transfer');
          header('Pragma: public');
          header('Expires: 0');
          header("Content-Type: application/force-download"); 
          header('Content-Type: application/octet-stream');
          header("Content-Type: application/download");
          header("Content-Length: ".$filesize);
          header("Content-disposition: attachment; filename=$filename");
          header('Content-Transfer-Encoding: binary');
          header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
          readfile($filepath);
      }
  </code></pre>
  
  <p>When I click the link I download the wav audio properly, but when I try to play the audio I get that "The file corrupt" - "It needs a special codec"</p>
  
  <p>What is it I'm doing wrong in my code?</p>
  
  <p>Thanks in advance.</p>