title: How to download the file to local machine from an application hosted in a server using python and jQuery
body: <p>Im working on an application where I take few details from a UI and connect to a backend API to fetch some data. Once I fetch the data, I need to write it to a file in the local machine. I used something like this </p>
  
  <pre><code>def csv_writer(&lt;few_params&gt;):
      output_file = "/tmp/{}_{}.csv".format(xyz,datetime.now())
      if &lt;something&gt; == "thing":
          headers = ["s_no", "id"] + keys
      else:
          headers = ["s_no", "feature_id"] + keys
      with open(output_file, "w", encoding="utf8") as file:
          writer = csv.writer(file)
          writer.writerow(headers)
  </code></pre>
  
  <p>This is working fine when I ran the application on a localhost, but now once that is deployed in higher environments, a dialog box is being showed that the file is downloaded to tmp location but unable to find it in my local machine. Is the file getting downloaded to tmp location of the server where the application is hosted ? </p>
  
  <p>How can I download the file into my local machine even if the application is hosted in any of the environment ? </p>
  
  <p>Note : Above code is written in Python.</p>