Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to Prevent APEXFileCropDialog from Opening for Non-Image Files?

Inês Tomé6 days ago

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!

Comments
Post Details
Added 6 days ago
0 comments
28 views