If you wanted to make a very simple file browser, let’s say /some/folder on server, and let the flask app run and handle any requests for /here/ to be /some/folder/here and then dig deeper? Because flask has that @app.route(('/') so each request is mapped to a function, but here you would like one function, say browse to handle all requests, and block requests for /../../, for example.
Is flask not well suited for this? Should I look for something else?
This is quite doable. See http://flask.pocoo.org/snippets/57/ for an example.
You should handle everything after the / as a path into your folder. You can then simply open that file name using open and write it as the Flask response.
E.g.
You might need to massage the path so that it is platform independent, using
os.path.separatorandos.path.joinetc.Also, you will need determine the mimetype for the file you are returning and . This can be done using the module
mimetypes.Also, see this link for the mechanics of returning a file directly, without having to read and return it. In python using Flask, how can I write out an object for download?