function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

How to resize image using fileUpload component

Hi all,
We have a Salesforce site where customers can upload pictures. For each picture uploaded, we want to resize it so they eventually won't consume all the space we have in our org. We are using the fileUpload lightning component. I have some JS code to resize an image. I plan to put this code in the controller. I see the fileUpload lightning component has the event onuploadfinished. This event seems too late in the process to resize the image using JS in the controller. I'm unclear as to how and when to run the JS code since this component doesn't seem to support any more events. How can resizing an image using this lightning component be done? And I'm not married to the fileUpload lightning component; if this can be accomplished another way I am open to that. Help

Sean FieldingSean Fielding
We have a solution where we 
  • Allow the file to be uploaded by the fileUpload component
  • Push the file to a photo manipulate site such as Google or Cloudinary
  • Resize the image
  • Retrieve the resized image
  • replave the original file with the resized image
If interested, we can quote out the package and solution