problem with image (merged) [message #272803] |
Sun, 07 October 2007 11:12  |
RyjuRaju
Messages: 48 Registered: September 2007
|
Member |
|
|
Hi
can anyone help me to solve the error "invalid file location,can't be opened". I am trying to insert an image file into a table.I am using a CENTOS system(similar to linux) and my image file is in desktop.The properties of the file shows the location as
'/home/oracle/Desktop'.But an error is showing.I am not familiar with linux file location and path.Can anyone help me?
many thanks
Ryju
|
|
|
|
problem with inserting image [message #272807 is a reply to message #272803] |
Sun, 07 October 2007 12:50   |
RyjuRaju
Messages: 48 Registered: September 2007
|
Member |
|
|
Hi
i have got a problem while inserting an image into a table containing blob column.
CREATE OR REPLACE DIRECTORY images AS '/root/home/oracle/Desktop';
/
DECLARE
l_bfile BFILE;
l_blob BLOB;
BEGIN
INSERT INTO HTMLDB_APPLICATION_FILES (name, blob_content)
VALUES ( 'receipt1.gif', empty_blob())
RETURN blob_content INTO l_blob;
l_bfile := BFILENAME('IMAGES', 'receipt1.gif');
DBMS_LOB.fileopen(l_bfile, Dbms_Lob.File_Readonly);
DBMS_LOB.loadfromfile(l_blob, l_bfile, DBMS_LOB.getlength(l_bfile));
DBMS_LOB.fileclose(l_bfile);
UPDATE EXPENSEITEM
SET EXPRECIMG=(SELECT BLOB_CONTENT
FROM HTMLDB_APPLICATION_FILES
WHERE name ='receipt1.gif') , EXPRECID=(SELECT ID
FROM HTMLDB_APPLICATION_FILES
WHERE name ='receipt1.gif')
WHERE EINO=2;
COMMIT;
END;
/
the error is "File or lob operation FILEOPEN failed.Permission denied.
I have given permmision "create any directory" to this user.
Still error is showing.
Can anyone help me?
|
|
|
|
Re: problem with inserting image [message #272810 is a reply to message #272807] |
Sun, 07 October 2007 13:41   |
RyjuRaju
Messages: 48 Registered: September 2007
|
Member |
|
|
Hi
i have to add a image file from centos system to a table called expenseitem.I tried the above query and i dont know what permission i have to give more.i have already given create directory permission.Another intersting thing i found is if i change the eino to 1 which is not valid column data,it shows no error for the fist time but nothing happened(no image inserted.)But for the second time,same error occured.Any ideas
Thanks
Ryju
|
|
|
|