diff options
| author | Frederick Muriuki Muriithi | 2026-01-26 14:47:50 -0600 |
|---|---|---|
| committer | Frederick Muriuki Muriithi | 2026-01-26 14:47:50 -0600 |
| commit | b807626b37e9ac743287bfc7e092e71d77da5c26 (patch) | |
| tree | 9fc550f625cd6bee094e1bc16396c727c819cb03 /uploader/files/chunks.py | |
| parent | 5705666ac0025ecc83c9cdb4ee0ebf94983ee069 (diff) | |
| download | gn-uploader-b807626b37e9ac743287bfc7e092e71d77da5c26.tar.gz | |
Provide some utilities to fetch common config variables.
Diffstat (limited to 'uploader/files/chunks.py')
| -rw-r--r-- | uploader/files/chunks.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/uploader/files/chunks.py b/uploader/files/chunks.py index c4360b5..f63f32f 100644 --- a/uploader/files/chunks.py +++ b/uploader/files/chunks.py @@ -5,6 +5,8 @@ from typing import Iterator from flask import current_app as app from werkzeug.utils import secure_filename +from uploader.configutils import uploads_dir + def chunked_binary_read(filepath: Path, chunksize: int = 2048) -> Iterator: """Read a file in binary mode in chunks.""" @@ -29,4 +31,4 @@ def chunks_directory(uniqueidentifier: str) -> Path: """Compute the directory where chunks are temporarily stored.""" if uniqueidentifier == "": raise ValueError("Unique identifier cannot be empty!") - return Path(app.config["UPLOAD_FOLDER"], f"tempdir_{uniqueidentifier}") + return Path(uploads_dir(app), f"tempdir_{uniqueidentifier}") |
