From 6222ebc5ca0fdeaac9ce7addd07ee4dd900a1afb Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Tue, 16 Jan 2024 12:48:43 +0300 Subject: UI: Create UI to select from existing genotype datasets. --- qc_app/files.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'qc_app/files.py') diff --git a/qc_app/files.py b/qc_app/files.py index 205a39c..baac5ec 100644 --- a/qc_app/files.py +++ b/qc_app/files.py @@ -3,6 +3,7 @@ import hashlib from pathlib import Path from typing import Union from datetime import datetime +from flask import current_app from werkzeug.utils import secure_filename from werkzeug.datastructures import FileStorage @@ -21,3 +22,7 @@ def save_file(fileobj: FileStorage, upload_dir: Path) -> Union[Path, bool]: filepath = Path(upload_dir, filename) fileobj.save(filepath) return filepath + +def fullpath(filename: str): + """Get a file's full path. This makes use of `flask.current_app`.""" + return Path(current_app.config["UPLOAD_FOLDER"], filename).absolute() -- cgit v1.2.3