You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Flask's send_file takes a file name or object and returns a response that can be used to send this file to the client. Werkzeug doesn't have any analogue -- SharedDataMiddleware is the closest, but its API is better suited to serving directories and it doesn't have many of send_file's useful options.
Flask tends to build on Werkzeug, but that's not the case with send_file -- it's lower-level than most of Flask. It'd be better if Werkzeug contained the base functionality and Flask just provided the framework integration (like send_from_directory and get_send_file_max_age). And perhaps SharedDataMiddleware could use this common base too (right now they both have to deal with generating etags, etc).
The text was updated successfully, but these errors were encountered:
@pgjones pointed out that we should make Werkzeug's send_file implementation sans-io, so that it can be used with ASGI. Maybe he can elaborate on a design, but we'll need something where we can pass in data incrementally rather than passing an open file.