title: Save as dialog box while downloading a text file using php
body: <p>I am saving a textarea content as a .txt file using below code.It will create a test.txt file.</p>
  
  <pre><code>function feed_text_download(){
  if(isset($_POST['text_to_download']))
   {
     header('Content-disposition: attachment; filename=test.txt');
     header('Content-type: application/txt');
     echo $_POST['text_to_download'];
     exit; //stop writing
   }
  }
  add_action('after_setup_theme', 'feed_text_download');
  </code></pre>
  
  <p>I need to change the code in such a way that once I click save button, I will get  <code>save as</code> box and user can select filename instead of test.txt. I need help here.</p>