try fix
This commit is contained in:
parent
2bc33e0971
commit
2285480e1a
|
|
@ -80,7 +80,7 @@ async def s_api_v1_5_storage_post(request):
|
|||
make_log("uploader_v1.5", f"Resuming upload session with ID: {upload_id}", level="INFO")
|
||||
|
||||
# Determine the temporary file path based on upload_id
|
||||
temp_path = os.path.join(UPLOADS_DIR, f"temp_{upload_id}")
|
||||
temp_path = os.path.join(UPLOADS_DIR, f"v1.5_upload_{upload_id}")
|
||||
|
||||
# Check current size of the temporary file (if it exists)
|
||||
current_size = 0
|
||||
|
|
@ -99,8 +99,12 @@ async def s_api_v1_5_storage_post(request):
|
|||
try:
|
||||
mode = 'wb' if is_new_upload else 'ab'
|
||||
async with aiofiles.open(temp_path, mode) as out_file:
|
||||
async for chunk in request.stream:
|
||||
await out_file.write(chunk)
|
||||
data = request.body # Get the full body if available
|
||||
if data:
|
||||
await out_file.write(data) # Write the whole body at once
|
||||
else:
|
||||
async for chunk in request.stream:
|
||||
await out_file.write(chunk)
|
||||
new_size = os.path.getsize(temp_path)
|
||||
make_log("uploader_v1.5", f"Appended chunk. New file size: {new_size}", level="INFO")
|
||||
except Exception as e:
|
||||
|
|
|
|||
Loading…
Reference in New Issue