d6a270fd by 周伟奇

fix bug

1 parent 4c2b01b1
......@@ -282,8 +282,11 @@ class DocView(GenericView, DocHandler):
pdf_file = args.get('pdf_file')
file_write(pdf_file, tmp_save_path)
# if not fitz.open("pdf", pdf_file).isPDF:
try:
file = fitz.Document(tmp_save_path)
except Exception as e:
raise self.invalid_params(msg='invalid params: not a PDF file')
else:
if not file.isPDF:
file.close()
raise self.invalid_params(msg='invalid params: not a PDF file')
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!