Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

save impt

@app.route("/upload", methods=["GET", "POST"])
def upload():
    if request.method == 'POST':
        if 'file' not in request.files:
            print(1)
            flash('No file part')
            return redirect(request.url)
        file = request.files['file']
        if file.filename == '':
            print(2)
            flash('No selected file')
            return redirect(request.url)
        if file and allowed_file(file.filename):
            print(3)
            filename = secure_filename(file.filename)
            session["id"] = filename
            file.save(os.path.join('UPLOAD', filename))
            return redirect(url_for('uploaded',
                                    filename=filename))

    return render_template('upload.html')
Comment

PREVIOUS NEXT
Code Example
Python :: how to see what variable is closest to a higher element in python 
Python :: wand image resize 
Python :: how to get device hwid cmd 
Python :: django get all models 
Python :: encanto meaning spanish 
Python :: unhapppy man with monwy 
Python :: back of list 
Python :: transverse tensor in pytorch 
Python :: pinyin to pinyin numbers python 
Python :: long press selenium python 
Python :: Convert this bash command into Python echo have a nice day Quizlet 
Python :: how to capture multiple screens with ImageGrab 
Python :: non preemptive priority scheduling in c# 
Python :: how to use python-socker.io with fast api 
Python :: how to convert a axis label to non scientific notation in matploltlib 
Python :: pairwise swap in data structure in python 
Python :: email slicer in python code user input 
Python :: hello world with a variable in python 3 
Python :: date component 
Python :: label default text value python 
Python :: how to get the remainder of a number when dividing in python 
Python :: fouier transformation in python open cv 
Python :: python file is writable 
Python :: django validate_comma_separated_integer_list 
Python :: p and c in python 
Python :: crop image using opencv with height and width 
Python :: paystack python 
Python :: violajones python opencv 
Python :: python remove xa0 
Python :: how to install python on visual studio code 
ADD CONTENT
Topic
Content
Source link
Name
1+1 =