I created a database directory CREATE DIRECTORY APEX_FILE_DIR AS '/tmp/apex/mehabub/'and then chnaged the owner to oracle id with which my DB has been installed.
Actually when I am uploading the files I am doing as follows1) Upload file with Files Browse Item type based on WWV_FLOW_FILES
Mehabub Sheikh wrote:No I can't. And nor can anyone else until you provide full details of this mysterious "image slider" and why you think it can't access images from the database.
My Apex version is 4.2with EPG on CentOS 5 and my images are there under file system /tmp/apex/mehabub.
Could you please tell me how to get them displayed?
Mehabub Sheikh wrote:This is going round in circles. You said initially that the images have to be in the file system rather than the database because this is required by the "image slider":
Sorry for the confusion. Actually I want my images to be displayed through some thing like image slider.
I checked one such plug in but could not make out what it does.
So basically I want my images to be displayed through image slider.
My question is
1) Is there any such image slider plug in which I can use to display my images which are there under /tmp/oracle/mehabub folder?.
I checked that the image slider uses BLOB content stored in the tables. So I can not use that. Here I will get the images from the directory and display them one by one.Now you say:
Actually I want my images to be displayed through some thing like image slider.Implying that you don't have an "image slider", and therefore that the requirement to have the images in the file system is moot.
In the plug in region source I have entered the following query
create or replace PROCEDURE xxapps_img_display ( p_img_id IN NUMBER ) AS l_mime VARCHAR2 (255); l_length NUMBER; l_file_name VARCHAR2 (2000); l_lob_loc blob; c_db_drec CONSTANT VARCHAR2(20) :='APEX_FILE_DIR'; BEGIN SELECT mime_type ,filename ,blob_content ,DBMS_LOB.getlength (blob_content) INTO l_mime ,l_file_name ,l_lob_loc ,l_length FROM wwv_flow_files WHERE id = p_img_id; -- l_lob_loc := bfilename('APEX_FILE_DIR', l_file_name); -- l_length := dbms_lob.getlength(l_lob_loc); OWA_UTIL.mime_header (NVL (l_mime, 'application/octet'), FALSE); HTP.p ('Content-length:' || l_length); OWA_UTIL.http_header_close; WPG_DOCLOAD.download_file (l_lob_loc); END xxapps_img_display;
I have also done
select ID as id, '#OWNER#.xxapps_img_display?p_img_id=' ||ID as img, FILENAME as text, DESCRIPTION as description, 'bottom' as position from wwv_flow_files
Then I added my procedure XXAPPS_IMG_DISPLAY in wwv_flow_epg_include_mod_local function.
connect sys as sysdba --grant all users the ability to execute this procedure. jeet is my schema GRANT EXECUTE ON jeet.xxapps_img_display TO PUBLIC; --create synonym CREATE PUBLIC SYNONYM xxapps_img_display FOR jeet.xxapps_img_display;
And your app parsing schema
grant read on directory APEX_FILE_DIR to anonymous;
This my blog post might also help
grant read on directory APEX_FILE_DIR to jeet;