Replace image from input with Compressed one by Javascript?

0
I want to client-side compress an uploaded image, before sending it to the server, in order to save bandwidth and maximize upload speeds.  With the help of this JS compression library I’m already able to compress the image, but I’m not able to return the image back, so Mendix will pick it up.  Inside the console (of the browser, Chrome, I can see the reduced size being logged, but if I click next, to commit the object, I can clearly see the original file being transferred.  Does anyone has experience in this area and can help me out?
asked
1 answers
0

Hi Sander,

How are you using this library? Did you build a custom widget? 

I would look into using the client api to commit your document. Check out the mx.data.savedocument api.

https://apidocs.mendix.com/7/client/mx.data.html#.saveDocument

 

Hope this helps!

answered