tuomasiyyq
2017-08-06 03:40python中Permission denied访问错误,更改目录或者管理员运动都没用
from flask import Flask, render_template, request, redirect, url_for
from os import path
from werkzeug.utils import secure_filename
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html', title = 'tuomasi Home')
@app.route('/upload', methods=['GET', 'POST'])
def upload():
if request.method == 'POST':
f = request.files['file']
basepath = path.abspath(path.dirname(__file__))
upload_path = path.join(basepath, 'static\uploads')
f.save(upload_path, secure_filename(f.filename))
return redirect(url_for('upload'))
return render_template('upload.html')
if name == '__main__':
app.run(debug = True)
我的问题是:当我上传一个文件的时候,提示IOError: [Errno 13] Permission denied,无论我怎样修改目录,都是这个错误,使用管理员权限运行cmd也不行,求大神解答
- 点赞
- 回答
- 收藏
- 复制链接分享
1条回答
为你推荐
- 华为手机,已动态申请权限,但是无法读取相册,提示Permission Denied
- android
- 1个回答
- PHP file_put_contents返回'Permission Denied'(由于SELinux设置)
- apache
- rhel
- php
- 3个回答
- 在CentOS6中安装FVCOM,进行make出现错误,不知所措
- linux
- centos
- 2个回答
- linux服务器启动项目报错Permission denied.
- 开发语言
- 2个回答
- 在spatie / laravel-permission中使用Admin表而不是用户表
- laravel
- php
- 1个回答
换一换