我正在尝试使用curl和python flask将文件上传到服务器。下面是我如何实现的代码。关于我在做什么的任何想法。curl -i -X PUT -F name=Test -F filedata=@SomeFile.pdf "http://localhost:5000/" @app.route("/", methods=['POST','PUT'])def hello(): file = request.files['Test'] if file and allowed_file(file.filename): filename=secure_filename(file.filename) print filename return "Success"以下是服务器发回的错误<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><title>400 Bad Request</title><h1>Bad Request</h1><p>The browser (or proxy) sent a request that this server could not understand.</p>提前致谢。
添加回答
举报
0/150
提交
取消