Commit 880fa09e authored by Mickaël Desfrênes's avatar Mickaël Desfrênes
Browse files

handle complete.* file in partial upload dir

parent 2f4fb1f1
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -295,11 +295,12 @@ def upload_partial(request: HttpRequest) -> HttpResponse:
        return HttpResponse("Length Required", status=411)

    # All chunks are complete, time to assemble
    f_name = "{}/complete{}".format(partials_dir, f_extension)
    if len(glob("{}/{}-*.part".format(partials_dir, total_chunks))) == int(
        total_chunks
    ):
    ) or os.path.exists(f_name):
        Path(lock_file_path).touch()  # lock dir
        f_name = "{}/complete{}".format(partials_dir, f_extension)
        if not os.path.exists(f_name):
            _join_parts(partials_dir, f_name, file_hash, total_chunks)
        with open(f_name, "rb") as f:
            try: