Python Forum
Flask, send_from_directory not working : solved
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Flask, send_from_directory not working : solved
#1
Question 
Hi everyone,

here my simple test code :

def download():
	try:
		return send_from_directory('C:\\original.jpg', filename='original.jpg', as_attachment=True)
	
	except FileNotFoundError:
		abort(404)
No matter what I try I get in the Internet browser

Quote:Not Found

The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.

and this message is not even triggered by the except :/

Any ideas ?
Reply


Messages In This Thread
Flask, send_from_directory not working : solved - by SpongeB0B - Jan-26-2021, 06:12 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Question [Solved] Running Gunicorn with flask.... SpongeB0B 1 1,624 Jun-27-2022, 03:09 PM
Last Post: SpongeB0B
Thumbs Up Flask do not accept sub-folder in Template ?! : Solved SpongeB0B 2 3,449 Jan-15-2021, 08:09 AM
Last Post: ndc85430
  My flask website not working properly Aggam 2 2,165 Nov-03-2020, 09:53 AM
Last Post: Aggam
  Flask, Posgresql - Multiple requests are not working bmaganti 5 2,767 Feb-20-2020, 03:02 PM
Last Post: bmaganti
  Flask Streaming not working on IIS Windows Revencu 0 2,309 Nov-09-2019, 10:31 PM
Last Post: Revencu
  flask app to save images locally when deployed on heroku not working Prince_Bhatia 1 5,278 Feb-20-2019, 11:59 PM
Last Post: snippsat
  Serving mixed filenames with send_from_directory() errors out. nikos 0 1,893 Sep-20-2018, 03:11 AM
Last Post: nikos
  Cannot serve file with send_from_directory nikos 2 2,526 Sep-19-2018, 09:25 PM
Last Post: nikos

Forum Jump:

User Panel Messages

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