Closed timkelly0810 closed 4 years ago
What does grapesjs send images to a database as? We are trying to determine how grapes sends images to spring so that we can set up our database to receive the incoming images.
@timkelly0810 you can check the grapesjs output like this:
editor.on('storage:store', (m) => {
console.log(m)
})
cheers!
@timkelly0810 to disable encoding just turn false this option ALL YOU NEED to know about uploading assets is here: https://grapesjs.com/docs/modules/Assets.html#uploading-assets
My team and I built an application that uses grapesjs to build an email template. When pictures are introduced into the template they are automatically base64 encoded which was found to come from line 77 of: https://github.com/artf/grapesjs/blob/dev/src/asset_manager/config/config.js#L77. Since they are being base64 encoded and therefor cannot be directly sent to most email clients without being blocked, we were thinking about sending the images to our local database to be held there. We have noticed that when the url source of an image is used instead of the encoding, the images show in an email. So, where in the grapesjs code does it post an image to an upload endpoint? Are the headers automatically set by grapes or do we need to specify x-content-type, content-type, etc? Is there any documentation for uploading images to a database? Thank you.