b4009530 by 周伟奇

add remove tmp file

1 parent d6a270fd
......@@ -285,10 +285,12 @@ class DocView(GenericView, DocHandler):
try:
file = fitz.Document(tmp_save_path)
except Exception as e:
os.remove(tmp_save_path)
raise self.invalid_params(msg='invalid params: not a PDF file')
else:
if not file.isPDF:
file.close()
os.remove(tmp_save_path)
raise self.invalid_params(msg='invalid params: not a PDF file')
file.close()
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!