Hi everyone,
I'm working on a form in Oracle APEX (v23.2) that includes an Image Upload item with "Enable Image Crop" set to Yes. The cropping dialog (APEXFileCropDialog
) works great for valid image files like PNG and JPEG.
However, I want to prevent the crop dialog from opening if the user selects a file that is not an image (e.g., PDF, DOCX, etc.). Ideally, I’d like to validate the MIME type on the client side and show an error message using apex.message.showErrors
, without triggering the cropper.
I’ve tried intercepting the change
event and using event.stopImmediatePropagation()
or replacing the file input element, but the crop dialog still opens before my validation can block it.
Has anyone successfully prevented the cropper from opening in this scenario?
Is there a supported way to hook into the cropper logic or delay it until validation passes?
Thanks in advance!