http - Can I redirect to a local file using Python Flask? -


i have html file i've generated contains links serviced flask routes. on handling click-through, flask twiddling, , 1 of 2 things:

  • either redirects external bog-standard url, or;
  • redirects mp3 file stored locally on disk.

i'm using flask redirect clicks external links using return redirect(url, 302). works fine.

i want play mp3 files in browser, , want similar redirect file://path/to/file.mp3.

setting url point , calling redirect() doesn't seem work; browser gets stuck @ flask route path.

i'm assuming it's knowledge of http , flask that's failing on occasion. what's best way achieve want do? thinking send_from_directory() wasn't wanted...

thanks in advance.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -