1. Create a table with blob cloumn
create table user_info
(
user_id varchar2(50),
user_name varchar2(200),
user_photo blob,
filename varchar2(3000),
mimetype varchar2(3000),
last_update date ,
wk_date date default to_date(sysdate,'DD-MON-RR'),
wk_time varchar2(50) default to_char (sysdate,'HH24:MI:SS')
)
/
1.Create application item name > 'USER_ID',> Session State Protection > Unrestricted.
2.Create Application Processes > 'GETIMAGEFILE',> Process Point > Ajax Callback, > PL/SQL Code >
begin
for c1 in (select * from employee_information
where USER_ID= :USER_ID) loop
sys.htp.init;
sys.owa_util.mime_header( c1.MIME_TYPE, FALSE );
sys.htp.p('Content-length: ' || sys.dbms_lob.getlength( c1.PICTURE));
sys.htp.p('Content-Disposition: attachment; filename="' || c1.FILENAME || '"' );
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.PICTURE);
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:25px;height:25px;border-radius:50%;cornflowerblue" src="f?p=&APP_ID.:0:&APP_SESSION.:APPLICATION_PROCESS=GETIMAGEFILE:::USER_ID:&APP_USER." alt=" ">
2.Create Application Processes > 'GETIMAGEFILE',> Process Point > Ajax Callback, > PL/SQL Code >
begin
for c1 in (select * from employee_information
where USER_ID= :USER_ID) loop
sys.htp.init;
sys.owa_util.mime_header( c1.MIME_TYPE, FALSE );
sys.htp.p('Content-length: ' || sys.dbms_lob.getlength( c1.PICTURE));
sys.htp.p('Content-Disposition: attachment; filename="' || c1.FILENAME || '"' );
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.PICTURE);
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:25px;height:25px;border-radius:50%;cornflowerblue" src="f?p=&APP_ID.:0:&APP_SESSION.:APPLICATION_PROCESS=GETIMAGEFILE:::USER_ID:&APP_USER." alt=" ">
No comments:
Post a Comment