send_from_directory
Send a file from within a directory using :func:send_file.
def send_from_directory(
directory: os.PathLike[str] | str,
path: os.PathLike[str] | str,
kwargs: t.Any
) - > Response
Send a file from within a directory using :func:send_file. This is a secure way to serve files from a folder, such as static files or uploads. Uses :func:~werkzeug.security.safe_join to ensure the path coming from the client is not maliciously crafted to point outside the specified directory. If the final path does not point to an existing regular file, raises a 404 :exc:~werkzeug.exceptions.NotFound error.
Parameters
| Name | Type | Description |
|---|---|---|
| directory | `os.PathLike[str] | str` |
| path | `os.PathLike[str] | str` |
| kwargs | t.Any | Arguments to pass to :func:send_file. |
Returns
| Type | Description |
|---|---|
Response |