@app.route('/upload', methods=['POST'])
def handle_upload():
for key, f in request.files.items():
if key.startswith('file'):
f.save(os.path.join(app.config['UPLOADED_PATH'], f.filename))
return '', 204
@app.route('/form', methods=['POST'])
def handle_form():
title = request.form.get('title')
description = request.form.get('description')
return 'file uploaded and form submit<br>title: %s<br> description: %s' % (title, description)
参考上面代码,可以正常进行文件上传,请问如何在hand_form中需要获得视频的上传链接地址,目的是为了在handle_from中和title,description的基础上,新增加video_src,一并通过表单提交,最后可以在数据库中保存。
因为video_src可以在handle_upload中得到,但怎么传递到handle_form视图中呢?