Попытка фикса .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:
@ -24,12 +24,15 @@ async def download_file(token: str):
|
||||
raise e.NotFoundException
|
||||
|
||||
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(
|
||||
content=file_bytes,
|
||||
media_type=data['content_type'],
|
||||
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