title: CodeIgniter's force_download() problems
body: <p>I'm trying to generate a .json file to download using CodeIgniter's force_download() in an Ajax call, but it doesn't work as expected.</p>
  
  <p>Here is my Ajax call: </p>
  
  <pre><code>$.ajax({
      url: /myfunction, 
      type: 'POST', 
      data: {value_sent: my_json_array}
  });
  </code></pre>
  
  <p>And my PHP function:</p>
  
  <pre><code>public myfunction()
  {
      $dl_array = $this-&gt;input-&gt;post("value_sent");
      $this-&gt;load-&gt;helper('download');
      force_download("file.json", $dl_array);
  }
  </code></pre>
  
  <p>Data is sent (I double checked), but download prompt is never shown. I assume force_download() fails, but I don't understand why. </p>
  
  <p>Any help is much appreciated, thanks!</p>