diff --git a/flask/helpers.py b/flask/helpers.py index e59f7d3c..a4785ed4 100644 --- a/flask/helpers.py +++ b/flask/helpers.py @@ -609,6 +609,9 @@ def send_from_directory(directory, filename, **options): :param options: optional keyword arguments that are directly forwarded to :func:`send_file`. """ + # Expand relative directories to the app's root_path + if not os.path.isabs(directory): + directory = os.path.join(current_app.root_path, directory) filename = safe_join(directory, filename) if not os.path.isfile(filename): raise NotFound()