to check if file exists on application server from forms
458094Nov 2 2006 — edited Nov 10 2006Hello!
Web.show_document opens the file from application server in the browser.But
I want to first check whether the file exists in apllication server.I tried the following pl/sql code.But it doesn't work.
declare
my_file text_io.file_type;
flnm1 varchar2(100);
begin
flnm1:='192.168.1.53:7779/forms90/pdf/j'||:caseblock.caseyear||'/'||lower('j'||:casetype||:caseno||'.pdf');
my_file := text_io.fopen(flnm1,'R');
if text_io.is_open(my_file) then
message('opened');
message('opened');
--:parameter.file_exist := 'TRUE';
text_io.fclose(my_file);
web.show_document('http://192.168.1.53:7779/forms90/pdf/j'||:caseblock.caseyear||'/'||lower(flnm1),'_blank');
end if;
exception
when others then
if sqlcode=-302000 and not text_io.is_open(my_file) then
--:parameter.file_exist := 'FALSE';
MESSAGE('tHE fILE DOES NOT EXISTS');
MESSAGE('tHE fILE DOES NOT EXISTS');
else
--:parameter.file_exist := 'N/A';
MESSAGE('hAI');
MESSAGE('HAI');
end if;
end;
But it always executes the exception that the file does not exists.But the required file which I am searching is available in application server.
Does text_io.fopen() function will check whether the file exists in application server.
If I use the same text_io.fopen function to check if the file exists in local machine it works.
Please suggests me how to check whether a file exists in apllication server or not.
It is very urgent.
Jayashree