📜  烧瓶请求文件上传到保管箱 - Python 代码示例

📅  最后修改于: 2022-03-11 14:47:02.276000             🧑  作者: Mango

代码示例1
@app.route('/uploadtest', methods=['POST', 'GET'])
def get_dropbox_files():
    if request.method == 'POST':
        uploadedfile = request.files['file']
        client = dbx_client
        f = secure_filename(uploadedfile.filename)
        path="/nameinlights/" + f
        dbx_client.files_upload(f.encode(), path)
        flash("Added" + " " + f + " " + "to Name in Lights Folder", 'success')

            
    return render_template('uploadtest.html', file_list=file_list)