@chang.route('/sc',methods = ['POST'])
def sc():
if request.method=='POST':
f = request.files["file"]
base_path = path.abspath(path.dirname(__file__))
upload_path = path.join(base_path)
file_name = upload_path + secure_filename(f.filename)
f.save(file_name)
return redirect(url_for('upload'))
return render_template('upload.html')
sc_url = 'http://127.0.0.1:5000/sc'
files = {'file': ('ceshi.jpg', open('ceshi.jpg', 'rb'))}
b = requests.post(sc_url,files = files,timeout=10)