Answers for "flask request file upload to dropbox"

0

flask request file upload to dropbox

@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)
Posted by: Guest on August-28-2021

Python Answers by Framework

Browse Popular Code Answers by Language