In Oracle Forms 12.2.1.4.0 (FSAL - Java 8.361), I have an issue that used to work in 11.1.1.3 Forms (and still does), but doesn't with version 12c.
We upload documents to the database using webutil (no problem). In Forms, the user has the ability to download the form (no problem) or view the document. We have a “View” button that the users can press that will download the specific file from the database to the users “c:\users\username\AppData\Roaming” directory (no problem) then open the document using the client_host command. The client_host command seems to open every document with the exception of pdfs using Adobe Acrobat.
This is the actual code:
declare
vbool boolean;
v_directory varchar2(4000);
vfile1 varchar2(120);
vfile2 varchar2(120);
begin
v_directory := 'C:\Users\' || webutil_clientinfo.get_user_name || '\AppData\Roaming';
vfile1 := v_directory || '\'||:supporting_doc.filename;
if INSTR(:parameter.current_user_roles, 'CCU_CLERK') > 0 or
INSTR(:parameter.current_user_roles, 'CCU_AGENT') > 0 or
INSTR(:parameter.current_user_roles, 'CCU_MANAGER') > 0 or
INSTR(:parameter.current_user_roles, 'CCU_ADMIN') > 0 or
INSTR(:parameter.current_user_roles, 'CCU_BRASS') > 0 then
if :supporting_doc.filename is not null then
--
-- Download the file to the client windows temp dir
--
vbool := webutil_file_transfer.DB_To_Client_With_Progress
(vfile1, --filename
'supporting_doc', --table of Blob item
'doc_blob', --Blob column name
'id_support = '||:supporting_doc.id_support,
'Downloading from Database', --Progress Bar title
'Wait to Complete'); --Progress bar subtitle
--
-- Get the filename in the correct Windows format for any spaces
--
vfile2 := '"" '||'"'||vfile1||'"';
--
-- Open the file on the client's windows PC
--
client_host('cmd /c start '||vfile2);
end if;
else
display_alert('You are not authorized to view this record!!!',1);
end if;
end;
The interesting thing is, that this is not an issue on 11g for any user and not an issue with 12c if the user is an Administrator, but if the user is not an Administrator, the pdf will not open unless it is already running on the user's computer. If we open Task Manager, we can see that it opens two Adobe sessions, but the pdf is never displayed.
We have made sure that the the user has full access to the file and they file folders but it doesn't help unless they are an actual admin. The user can navigate to the file and double-click it and the pdf will open just fine. The user can also open a CMD window and type in the client_host command and it opens just fine, it is only when initiated via Forms that it won't open, and only the pdf:
Example, of CMD command:
start “" “Erica A Beard.pdf”
We did modify client host to not include the title in the first parameter and removed the word start but that didn't work either:
--
-- Get the filename in the correct Windows format for any spaces
--
--vfile2 := '"" '||'"'||vfile1||'"';
vfile2 := '"'||vfile1||'"';
--
-- Open the file on the client's windows PC
--
--client_host('cmd /c start '||vfile2);
client_host('cmd /c '||vfile2);
We have Googled a million different statements but cannot find an answer. If anyone has any ideas, please let me know.