-1

Making a server that allows access of videos on one device to others on the network.

Is there a way to allow flask to to allow the src of the videos be from a folder that isnt under the static in the directory given.

Copying files over to the static directory, though would work does not solve the problem as the space this would then take up.

doomed824
  • 3
  • 1

1 Answers1

0

Using other web servers such as Nginx is the preferred way for performance's sake, but if you want to use Flask for it, you can use send_from_directory.

import flask

@app.route('/videos/<path:filename>')
def download_file(filename):
    return flask.send_from_directory(app.config['VIDEO_FOLDER'],
                               filename, as_attachment=True)
Hurried-Helpful
  • 1,850
  • 5
  • 15