mirror of
https://github.com/flibusta-apps/fb2converter_server.git
synced 2025-12-06 15:05:37 +01:00
Add buffered uploaded file read
This commit is contained in:
@@ -35,12 +35,11 @@ async def convert(
|
|||||||
converted_temp_filename = str(temp_uuid) + "." + format
|
converted_temp_filename = str(temp_uuid) + "." + format
|
||||||
|
|
||||||
async with aiofiles.open(temp_filename, "wb") as f:
|
async with aiofiles.open(temp_filename, "wb") as f:
|
||||||
content = await file.read()
|
while (content := await file.read(1024)):
|
||||||
|
if isinstance(content, str):
|
||||||
|
content = content.encode()
|
||||||
|
|
||||||
if isinstance(content, str):
|
await f.write(content)
|
||||||
content = content.encode()
|
|
||||||
|
|
||||||
await f.write(content)
|
|
||||||
|
|
||||||
proc = await asyncio.create_subprocess_exec(
|
proc = await asyncio.create_subprocess_exec(
|
||||||
"./bin/fb2c",
|
"./bin/fb2c",
|
||||||
|
|||||||
Reference in New Issue
Block a user