I'm trying to add some functionality within the new Umbraco 14 backoffice. Whenever a user selects an image to upload, I want to read the base64 image in order to figure out the size of the image, and give a notification based on this data. I have successfully created a workspace context that loads whenever the 'upload file' modal opens. I'm also able to consume the notification context and show the required notifications.
Problem: I'm trying to consume the media workspace context within my workspace and listen to a change within the Umbraco Image Cropper. This way I can receive the temporary image data within my own workspace once it has been selected within the cropper.
I have tried receiving data through several methods within the media workspace context class, but I have not yet found an answer. I'd love to get some help from more experienced developers to know what things I'm missing. Thank you! :)
This is my current code; it properly listens to the umbracoFile field, but only receives an object with a temporaryFileId in there. The src is an empty string, assuming this gets filled only when the image is confirmed/uploaded. Does anybody know how to obtain the temporary file (base64) itself within my code?
Umbraco 14 - Context API help needed!
Hi there!
I'm trying to add some functionality within the new Umbraco 14 backoffice. Whenever a user selects an image to upload, I want to read the base64 image in order to figure out the size of the image, and give a notification based on this data. I have successfully created a workspace context that loads whenever the 'upload file' modal opens. I'm also able to consume the notification context and show the required notifications.
Problem: I'm trying to consume the media workspace context within my workspace and listen to a change within the Umbraco Image Cropper. This way I can receive the temporary image data within my own workspace once it has been selected within the cropper.
I have tried receiving data through several methods within the media workspace context class, but I have not yet found an answer. I'd love to get some help from more experienced developers to know what things I'm missing. Thank you! :)
This is my current code; it properly listens to the umbracoFile field, but only receives an object with a temporaryFileId in there. The src is an empty string, assuming this gets filled only when the image is confirmed/uploaded. Does anybody know how to obtain the temporary file (base64) itself within my code?
is working on a reply...