title: Create a text file with MIME type application/octet-stream
body: <p>I need to create a text file with mime type application/octet-stream.</p>
  
  <p>With the following c# code:</p>
  
  <pre><code>string[] text = P_Data.M_Content.Split(',');
  System.IO.File.WriteAllLines(@"c:\temp.txt", text);
  </code></pre>
  
  <p>This code generates a physical file on the server. However, the mime type is text/plain.</p>
  
  <p>I need to modify this code in order to create a file with mime type application/octet-stream</p>
  
  <p>Any ideas how this can be achieved?</p>
  
  <p>EDIT
  This is the request from the GUI (ExtJS)</p>
  
  <pre><code>success: function(P_Response){
      var res = Ext.util.JSON.decode(P_Response.responseText);
      if(res == 'SUCCESS') window.location.href = 'myfile.txt';
      else alert('the error message');                                                                                                                                                                                                                            
  },
  </code></pre>
  
  <p>By using this code, a popup window is opened to download the file if I create a .doc instead of a .txt</p>