To make a limitation on uploading image on Oracle Apex 5. You can do this steps.
Step-1
Select the File Browser field and Create a Validation
Step-2
Then Validation>> Type >> PL/SQL Function (Return Error Type)
and pest the code:
declare
cursor c is
select doc_size
from apex_application_files
where name = :P18_IMAGE; -- where write the name of file upload field
v_size number := 0;
v_msg varchar2(100);
begin
open c;
fetch c into v_size;
close c;
if (v_size < 51200) then -- (50 kb*1024 byte=51200)
v_msg := 'Image must be at least 50KB!';
DELETE from APEX_APPLICATION_FILES WHERE name = :P18_IMAGE; ---where write the name of file upload field
return v_msg;
elsif (v_size > 204800) then -- (200 kb*1024 byte=51200)
v_msg := 'Image size cannot be more than 200kb!';
DELETE from APEX_APPLICATION_FILES WHERE name = :P18_IMAGE;
-- where write the name of file upload field
return v_msg;
end if;
--:p15_rcremark := :P15_RCAPPIMG_temp;
end;
Then save the page and try.
Muhammad Abdul Qaium is a Database Engineer/Oracle Apex Developer/BI Developer (in Atlanta, USA) who is an Oracle Certified Cloud Architect Professional, OCI Autonomous DB specialist as well as Oracle Business Intelligence Foundation Suite 11g Certified Implementation Specialist with extensive expertise in Database design , PL/SQL, Oracle Apex, Microsoft SSIS, ETL, Power BI, Qlik Sense, OBIEE. Contact: qaiuminfo@gmail.com
Search This Blog
Subscribe to:
Post Comments (Atom)
Check Difference Between Two Database Objects
Step-1. Create Two DBLINK to connect with Two Database then Step-2. define logindb= DBLINKONE define remotedb= DBLINKTWO define schema_name=...
-
Search by keyword from Oracle Database Objects. select owner, type, name, line, text from dba_source where 1 = 1 and text like '%TEXT Y...
-
We Can Export Application Components individually from Oracle Apex. Application > Shared Components > Export Application Compo...
No comments:
Post a Comment