bugfix
This commit is contained in:
parent
9e47ec3243
commit
da511325e1
@ -101,13 +101,17 @@ def b64media2url(request, mediafile):
|
|||||||
entire_url = env.entire_url
|
entire_url = env.entire_url
|
||||||
debug(f'{request=}{type(request)}, {len(mediafile)=}, {entire_url=}')
|
debug(f'{request=}{type(request)}, {len(mediafile)=}, {entire_url=}')
|
||||||
if mediafile.startswith('data:'):
|
if mediafile.startswith('data:'):
|
||||||
fs = FileStorage()
|
try:
|
||||||
fname = getFilenameFromBase64(mediafile)
|
fs = FileStorage()
|
||||||
fpath = fs._name2path(fname)
|
fname = getFilenameFromBase64(mediafile)
|
||||||
debug(f'{env.keys()=},{fpath=},{fname=}')
|
fpath = fs._name2path(fname)
|
||||||
base64_to_file(mediafile, fpath)
|
debug(f'{env.keys()=},{fpath=},{fname=}')
|
||||||
path = fs.webpath(fpath)
|
base64_to_file(mediafile, fpath)
|
||||||
return entire_url('/idfile?path=') + env.quota(path)
|
path = fs.webpath(fpath)
|
||||||
|
return entire_url('/idfile?path=') + env.quota(path)
|
||||||
|
except Exception as e:
|
||||||
|
exception(f'{e}\n{format_exc()}')
|
||||||
|
return ' '
|
||||||
if mediafile.startswith('http://') or mediafile.startswith('https://'):
|
if mediafile.startswith('http://') or mediafile.startswith('https://'):
|
||||||
return mediafile
|
return mediafile
|
||||||
url = entire_url('/idfile?path=') + env.quota(mediafile)
|
url = entire_url('/idfile?path=') + env.quota(mediafile)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user