bugfix
This commit is contained in:
parent
3a4ef54399
commit
6d700279fe
@ -187,13 +187,13 @@ async def downloadfile(url, headers=None, params=None, data={}):
|
||||
fs = FileStorage()
|
||||
fpath = fs._name2path(filename, userid='tmp')
|
||||
try:
|
||||
shc = StreamHttpClient()
|
||||
async with aiofiles.open(fpath,'wb') as f:
|
||||
shc = StreamHttpClient()
|
||||
async for chunk in shc('GET', url,
|
||||
headers=headers,
|
||||
params=params,
|
||||
data=data):
|
||||
f.write(chunk)
|
||||
await f.write(chunk)
|
||||
return fpath
|
||||
except Exception as e:
|
||||
exception(f'save {url} to {fpath} exception:{e}')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user