Exemple #1
0
def upload():
    insert_photo(
        request
    )  # Call function in 'models.py' to process the database transaction
    return render_template(
        'submit-photo.html'
    )  # Return a page to inform the user of a successful upload
Exemple #2
0
def upload():
    filename = secure_filename(request.files['photo'].filename)
    uuid = "%s-%s-" % (time.time(), HOSTNAME)
    filename = uuid + filename

    insert_photo(
        request, filename
    )  # Call function in 'models.py' to process the database transaction
    upload_photo(
        request.files['photo'],
        filename)  # Call function in 'models.py' to upload photo to ECS
    # Return a page to inform the user of a successful upload
    return render_template('submit-photo.html')