diff options
Diffstat (limited to 'uploader')
-rw-r--r-- | uploader/files/views.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/uploader/files/views.py b/uploader/files/views.py index 06481ee..7e2ef0b 100644 --- a/uploader/files/views.py +++ b/uploader/files/views.py @@ -8,6 +8,11 @@ from .chunks import chunk_name, chunks_directory files = Blueprint("files", __name__) +def target_file(fileid: str) -> Path: + """Compute the full path for the target file.""" + return Path(app.config["UPLOAD_FOLDER"], fileid) + + @files.route("/upload/resumable", methods=["GET"]) def resumable_upload_get(): """Used for checking whether **ALL** chunks have been uploaded.""" @@ -56,7 +61,7 @@ def resumable_upload_post(): "resumableFilename", default="", type=str) or "" _fileid = request.form.get( "resumableIdentifier", default="", type=str) or "" - _targetfile = Path(app.config["UPLOAD_FOLDER"], _fileid) + _targetfile = target_file(_fileid) if _targetfile.exists(): return jsonify({ |