Python Forum
Cannot serve file with send_from_directory
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cannot serve file with send_from_directory
#1
# Prepare selected file for download...
filepath = '/home/nikos/wsgi/static/files/'
send_from_directory( filepath, filename, as_attachment=True )
'filename' is a valid filename value
i get the following error:

Quote:Bad Request
The browser (or proxy) sent a request that this server could not understand.

Why instead of serving the file the error mentions proxy or bad request?
The script is a mod_wsgi script.
Reply


Messages In This Thread
Cannot serve file with send_from_directory - by nikos - Sep-17-2018, 06:13 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Question Flask, send_from_directory not working : solved SpongeB0B 2 7,714 Jan-26-2021, 07:02 AM
Last Post: SpongeB0B
  Serving mixed filenames with send_from_directory() errors out. nikos 0 1,932 Sep-20-2018, 03:11 AM
Last Post: nikos
  Django serve list-file foralobo 4 4,493 Oct-03-2017, 03:48 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020