Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.9k views
in Technique[技术] by (71.8m points)

python - Flask in Ubuntu 18.04 cannot receive html form file uploads

thanks to the community here I have managed to deploy and run my flask app in production. Currently the only issue I am facing is when I upload form to store in my static folder I keep getting error file config not found. Ran the test on localhost Ubuntu and it worked fine. Do I need to do additional settings to enable file upload in production mode? below is a snippet of the code for your reference. Again thanks a lot for your help.

root@gamy-beginner:/# app.config['FILE_UPLOADS1'] = '/var/www/html/test/static/s torage/local'

[Wed Jan 13 10:49:47.064757 2021] [wsgi:error] [pid 25985:tid 139888930240256] [client 175.144.166.163:51433] return self.view_functions[rule.endpoint](**req.view_args), referer: http://onlinebiztrust.com/CIDB_renewal_form3

[Wed Jan 13 10:49:47.064762 2021] [wsgi:error] [pid 25985:tid 139888930240256] [client 175.144.166.163:51433] File "var/www/html/test/init.py", line 267, in CIDB_renewal_form3, referer: http://onlinebiztrust.com/CIDB_renewal_form3

[Wed Jan 13 10:49:47.064766 2021] [wsgi:error] [pid 25985:tid 139888930240256] [client 175.144.166.163:51433] files.save(os.path.join(app.config['FILE_UPLOADS'], filename)), referer: http://onlinebiztrust.com/CIDB_renewal_form3

[Wed Jan 13 10:49:47.064770 2021] [wsgi:error] [pid 25985:tid 139888930240256] [client 175.144.166.163:51433] File "/usr/local/lib/python3.6/dist-packages/werkzeug/datastructures.py", line 3066, in save, referer: http://onlinebiztrust.com/CIDB_renewal_form3

[Wed Jan 13 10:49:47.064782 2021] [wsgi:error] [pid 25985:tid 139888930240256] [client 175.144.166.163:51433] dst = open(dst, "wb"), referer: http://onlinebiztrust.com/CIDB_renewal_form3

[Wed Jan 13 10:49:47.064788 2021] [wsgi:error] [pid 25985:tid 139888930240256] [client 175.144.166.163:51433] PermissionError: [Errno 13] Permission denied: '/var/www/html/test/static/storage/foreign/PCB_LED_strip_MCPCB_v5_2021-01-11_17-18-46.pdf', referer: http://onlinebiztrust.com/CIDB_renewal_form3

[Wed Jan 13 10:49:47.064811 2021] [wsgi:error] [pid 25985:tid 139888930240256] [client 175.144.166.163:51433] , referer: http://onlinebiztrust.com/CIDB_renewal_form3

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...