Flask giving error 400 on file upload
问题 I have the following <form action="classify_upload" method="post" id="upload-form"> <input type="file" name="imagefile" id="imagefile"/> <input type="submit" /> </form> And in my flask webapp I have the following rule: @webapp.route('/upload', methods=['POST']) def upload(): try: imagefile = flask.request.files['imagefile'] ... except Exception as err: ... But I am getting a error 400: bad request , which from my googling tells me Flask can not find the file under the key 'imagefile' which is