flask get summernote text 1

flask get summernote text

@app.route("/addImgSummer", methods=["POST"])
def addImgSummer():
    #Grabbing file:
    img = request.files["file"]    #<------ THIS LINE RIGHT HERE! Is #literally all I needed lol.

    # Below is me replacing the img "src" with my S3 bucket link attached, with the said filename that was added. 
    imgURL = "https://"+ S3_BUCKET_NAME +".s3.amazonaws.com/images/"+ img.filename

    return jsonify(url = imgURL)

Here is what the above code is Doing:
1. The user clicks the "add image" button in the summernote editor.
2. The user selects an image from their computer.
3. The image is uploaded to the S3 bucket.
4. The image is then displayed in the summernote editor.

Similar Posts