title: Download an excel file saved on flask server
body: <p>I have a flask app that has an existing xlsx file in the downloads folder. I am trying to make the front-end download the excel file on a button click. As of right now, my flask server is accessing the file correctly, but sending it as nonsensical string data in the response. I'm assuming I need to use some library to parse the data into an excel workbook and then download it, but I'm having trouble finding answers. 
  Here is the flask code: </p>
  
  <pre><code>
      @app.route('/download')
      @handle_errors
      def downloadFile():
          filename = request.args.get('filename')
          uploadPath = sys.path[0] + '\\workflow\\downloads'
          return send_file(uploadPath + '\\' + filename, as_attachment=True)
  
  </code></pre>
  
  <p>Here is the front end react code:</p>
  
  <pre><code>
      getFile = (e) =&gt; {
          e.preventDefault();
          e.persist();
          const filename = e.target.getAttribute('name');
          axios
            .get(`http://localhost:5000/download?filename=${filename}`)
            .then((data) =&gt; {
              console.log('this is data: ', data);
              console.log('Completed: download');
            })
            .catch(() =&gt; {
              console.log('We were not able to complete your request.');
            });
        };
  
  </code></pre>