GrapesJS / grapesjs

Free and Open source Web Builder Framework. Next generation tool for building templates without coding
https://grapesjs.com
BSD 3-Clause "New" or "Revised" License
22.36k stars 4.05k forks source link

Where in the grapesjs code does it post an image to an upload endpoint? #2369

Closed timkelly0810 closed 4 years ago

timkelly0810 commented 4 years ago

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.

pouyamiralayi commented 4 years ago

Adding Image Upload Feature

timkelly0810 commented 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.

pouyamiralayi commented 4 years ago

@timkelly0810 you can check the grapesjs output like this:

editor.on('storage:store', (m) => { 
    console.log(m)
})

cheers!

artf commented 4 years ago

@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