Closed gvanto closed 3 years ago
Hi @gvanto
This a complex requirement, I'm not sure it's possible. However, the files are uploaded to the media manager which can support CDNs and you can find the configuration for this in the config/media.php
file.
I am trying to intercept the file (Pages > Content > (menu bar) > Insert Image) upload location in order to push to Cloudinary and have the "link" (see image below) returned as a CDN url - (to make deployment easier, no need to worry about image url's referencing dev location on deployment of code to live server).
Chrome devtools > Network tab response (I would like to override this URL):
Looking at the class https://octobercms.com/docs/api/backend/formwidgets/richeditor (modules/backend/formwidgets/RichEditor.php) I can't seem to see an event being fired for when a file is uploaded? (but it seems this is a vendor JS editor froala, so would this even be possible?)
Perhaps the uploadUrl can be set somewhere, as with this example: https://jsfiddle.net/tocker/xnsbjc01/
Any help much appreciated.
PS: How does one typically deploy static pages content containing images? Because on dev my images are all referencing local URLs (dev environment), in the page markup... (since the markup is in code, I'm adding to VCS - then git pull on the live server but URLs are referencing dev location).