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)<form action="/updateTest" method="POST">
<h1 style="text-align:center">content</h1><textarea name=content id="summernote">{{value}<style>
$(document).ready(function() {
$('#summernote').summernote({
height: 300,
focus: true,
callbacks: {
onImageUpload(files) {
sendFile(files[0], data => {
let imgNode = document.createElement("img");
imgNode.setAttribute('src', data.url)
$(this).summernote('insertNode', imgNode);
})
}
}
});
});
var sendFile = function(file, callback) {
var data;
data = new FormData();
data.append("file", file);
return $.ajax({
url: "/addImgSummer",
data: data,
cache: false,
contentType: false,
processData: false,
type: 'POST',
success: function(data) {
return callback(data);
}
});
};
</style>
Also in HTML:
- index.js:1 Warning: <feGaussianBlur /> is using incorrect casing. Use PascalCase for React components, or lowercase for HTML elements.
- ionic badge
- Impossible to create the root directory "/var/www/html/laraship-subscription/storage/app/public/media/user_v1oz1Yz27j/26
- mobile prevent zoom
- html id
- php remove html tags
- pass dynamic javascript value to html
- html add line break in string on screen size
- html style left right
- salesforce aura input checkbox
- import ionic html
- html input dropdown
- buton html href
- vue v-model
- javascript remove html from text
- capture textarea value
- floating whatsapp button html
- foundation 5 dropdown alignment
- a tag
- table bootstrap with scrool
- current date in html5
- how to make form not reload page
- html ecrire en gras
- contact form html