在上传tif文件时出现UploadNotAllowed错误:
Traceback (most recent call last):
File "C:\Users\dell\anaconda3\Lib\site-packages\flask\app.py", line 2080, in wsgi_app
response = self.handle_exception(e)
File "C:\Users\dell\anaconda3\Lib\site-packages\flask\app.py", line 2077, in wsgi_app
response = self.full_dispatch_request()
File "C:\Users\dell\anaconda3\Lib\site-packages\flask\app.py", line 1525, in full_dispatch_request
rv = self.handle_user_exception(e)
File "C:\Users\dell\anaconda3\Lib\site-packages\flask\app.py", line 1523, in full_dispatch_request
rv = self.dispatch_request()
File "C:\Users\dell\anaconda3\Lib\site-packages\flask\app.py", line 1509, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "C:\Users\dell\anaconda3\Lib\site-packages\flask_login\utils.py", line 277, in decorated_view
return current_app.ensure_sync(func)(*args, **kwargs)
File "C:\Users\dell\Desktop\pear-admin-flask-master\pear-admin-flask-master\applications\common\utils\rights.py", line 21, in wrapper
return func(*args, **kwargs)
File "C:\Users\dell\Desktop\pear-admin-flask-master\pear-admin-flask-master\applications\view\admin\image.py", line 77, in upload2minio
file_url = upload_curd.save2cloud(foldId, file, mime)
File "C:\Users\dell\Desktop\pear-admin-flask-master\pear-admin-flask-master\applications\common\utils\upload.py", line 61, in save2cloud
filename = photos.save(file)
File "C:\Users\dell\anaconda3\Lib\site-packages\flask_uploads\flask_uploads.py", line 318, in save
raise UploadNotAllowed()
flask_uploads.exceptions.UploadNotAllowed
127.0.0.1 - - [23/Sep/2022 11:36:49] "POST /admin/image/upload HTTP/1.1" 500 19068 0.445996
* Detected change in 'C:\\Users\\dell\\anaconda3\\Lib\\site-packages\\flask_uploads\\flask_uploads.py', reloading
127.0.0.1 - - [23/Sep/2022 11:36:49] "GET /static/admin/component/layui/css/modules/layer/default/icon.png HTTP/1.1" 304 196 0.010997
* Restarting with watchdog (windowsapi)
这是因为flask_uploads不支持tif格式文件上传
解决方法: