Ticker

6/recent/ticker-posts

File and Image Type Extension Validation in Oracle Apex - Javainhand Tutorial

File and Image Type Extension Validation in Oracle Apex

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.


File and Image Type Extension Validation in Oracle Apex

Step 2:-Now create validation Right-click on P4_IMAGE item. The below screenshot will help you.

File and Image Type Extension Validation in Oracle Apex
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)$


File and Image Type Extension Validation in Oracle Apex
Step 4:- Add Error Message Upload Only JPF, PNG, JPEG Images Only.  The below screenshot will help you.
File and Image Type Extension Validation in Oracle Apex

NOTE:- YOU CAN ALSO CHANGE REGULAR EXPRESSION BASED ON YOUR REQUIREMENT.

Result Screenshot:-



If You Like This Tutorial Please Like Share And Comment.

Post a Comment

0 Comments