Hello Friends,
In this Oracle APEX Tutorial, I will explain to you how to validate File and Image Type Validation in Oracle Apex.
Basically, Most of the applications check file extensions before uploading the files and images in Oracle Apex. This validation ensures that users upload correct files if we can not control then users upload unusual files to the server.
I have taken an example of the image upload files if I will upload wrong file types or select then it validates that you are selecting the wrong image format or files.
Let's Start
Step 1:-Create a region with a file browse item. The below screenshot will help you.
Step 2:-Now create validation Right-click on P4_IMAGE item. The below screenshot will help you.
Step 3:- Add Below Details in Validation.you can change regular expression based on your requirement.
Identification: -Upload Valid File Format
Validation:- Type>Item Match Regular Expression.
Item:- P4_IMAGE
Regular Expression:- ([0-9a-zA-Z :\\-_!@$%^&*()])+(.jpg|.JPG|.png|.PNG|.jpeg|.JPEG|.gif|.GIF)$
Step 4:- Add Error Message Upload Only JPF, PNG, JPEG Images Only. The below screenshot will help you.
NOTE:- YOU CAN ALSO CHANGE REGULAR EXPRESSION BASED ON YOUR REQUIREMENT.
Result Screenshot:-
If You Like This Tutorial Please Like Share And Comment.
0 Comments
If you have any doubts, Please let me know