Delete zip file after downloading
This commit is contained in:
@@ -120,4 +120,5 @@ async def download_all(Authorize: AuthJWT = Depends(), session: AsyncSession = D
|
|||||||
for path in paths:
|
for path in paths:
|
||||||
zip_file.write(f"{settings.DATA_PATH}/{path}", os.path.basename(path))
|
zip_file.write(f"{settings.DATA_PATH}/{path}", os.path.basename(path))
|
||||||
|
|
||||||
return FileResponse(zip_path, media_type="application/zip", filename="signs.zip")
|
# return the zip file and delete it after the request is done
|
||||||
|
return FileResponse(zip_path, media_type="application/zip", filename="signs.zip", delete_after_request=True)
|
||||||
Reference in New Issue
Block a user