Попытка фикса .doc файла
All checks were successful
Build And Push / publish (push) Successful in 2m40s
All checks were successful
Build And Push / publish (push) Successful in 2m40s
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "HospitalAssistantBackend"
|
name = "HospitalAssistantBackend"
|
||||||
version = "1.5.10"
|
version = "1.5.11"
|
||||||
description = "Backend for Hospital Assistant"
|
description = "Backend for Hospital Assistant"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.13,<3.14"
|
requires-python = ">=3.13,<3.14"
|
||||||
|
|||||||
@ -24,12 +24,15 @@ async def download_file(token: str):
|
|||||||
raise e.NotFoundException
|
raise e.NotFoundException
|
||||||
|
|
||||||
data = loads(file_data)
|
data = loads(file_data)
|
||||||
file_bytes = b64decode(data['data'])
|
file_name = data['filename']
|
||||||
|
file_bytes = b64decode(data['data'].strip(), validate=True)
|
||||||
|
print(f'Header: {file_bytes[:8].hex(" ")}')
|
||||||
|
|
||||||
return Response(
|
return Response(
|
||||||
content=file_bytes,
|
content=file_bytes,
|
||||||
media_type=data['content_type'],
|
media_type=data['content_type'],
|
||||||
headers={
|
headers={
|
||||||
'Content-Disposition': f'attachment; filename="{data["filename"]}"'
|
'Content-Disposition': f'attachment; filename="{file_name}"',
|
||||||
|
'Content-Length': str(len(file_bytes)),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user