tuomasiyyq
tuomasiyyq
2017-08-06 03:40

python中Permission denied访问错误,更改目录或者管理员运动都没用

  • python

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条回答