1

The send_from_directory function seems to take path supplied to it as a relative path to its project directory by default. How can we supply an absolute path to it?

    @app.route('/download/<file>',methods=['GET'])
    def download_function(file):
        return send_from_directory("~/Desktop", file, as_attachment=True)
Siddhant
  • 11
  • 3
  • the first parameter is the *directory*, the second is the *filename*, you can pass any absolute path as directory. where did you get blocked exactly ? – PRMoureu Jun 28 '18 at 19:08
  • the directory parameter is relative to the current directory itself – Siddhant Jun 29 '18 at 04:54

0 Answers0