diff --git a/self_hosting_machinery/webgui/tab_upload.py b/self_hosting_machinery/webgui/tab_upload.py index b2cec079a..7fab827e0 100644 --- a/self_hosting_machinery/webgui/tab_upload.py +++ b/self_hosting_machinery/webgui/tab_upload.py @@ -149,11 +149,8 @@ async def _tab_files_upload(self, file: UploadFile): return JSONResponse(content=response_data, status_code=409) try: with open(tmp_path, "wb") as f: - while True: - contents = await file.read(1024) - if not contents: - break - f.write(contents) + contents = await file.read() + f.write(contents) os.rename(tmp_path, file_path) except OSError as e: log("Error while uploading file: %s" % (e or str(type(e))))