1. Create application item name > 'FILE_ID',> Session State Protection > Unrestricted.
2. Create Application Processes > 'GETIMAGE',> Process Point > Ajax Callback, > PL/SQL Code >
begin
for c1 in (select * from table_name
where column_id = :FILE_ID) loop
--
sys.htp.init;
sys.owa_util.mime_header( c1.PIC_TYPE, FALSE );
sys.htp.p('Content-length: ' || sys.dbms_lob.getlength( c1.PIC));
sys.htp.p('Content-Disposition: attachment; filename="' || c1.PIC_NM || '"' );
sys.htp.p('Cache-Control: max-age=3600'); -- tell the browser to cache for one hour, adjust as necessary
sys.owa_util.http_header_close;
sys.wpg_docload.download_file( c1.PIC );
apex_application.stop_apex_engine;
end loop;
end;
3. Create/Select navigation bar where you want to show image > User Defined Attributes 1.
<img style="width:35px;height:35px;border-radius:50%;background"
src="f?p=&APP_ID.:0:&APP_SESSION.:APPLICATION_PROCESS=GETIMAGE:::FILE_ID:&APP_USER." alt="No Image">
No comments:
Post a Comment