Client_to_db_with_progress
I've been using webutil functions for a while now with no errors. Recently I tried using client_to_db_with_progress and nothing happens, I don't get error messages, no files get uploaded, the application just hangs until I stop it. I'm using the sample form wu_test_106.fmb.
What follows is what I have done for the test.
Created table wu_test_table
Name Null? Type
ID NUMBER
DOC_NAME VARCHAR2(300)
DOC_BLOB BLOB
made sure webutil_db package is installed and all grants and synonyms were completed.
Made sure that parameter transfer.database.enabled=TRUE in webutil.cfg
this is the code behind the button that users push for upload:
BEGIN
message('will go to upload in a second');
upload_db;
exception
when others
then
message('File upload failed: '||sqlerrm);
end; }
and this is the code used to do the upload
PROCEDURE UPLOAD_DB IS
l_success boolean default FALSE;
BEGIN
message('about to upload');
l_success := webutil_file_transfer.Client_To_DB_with_progress
(:upload.file_name
,'WU_TEST_TABLE'
,'DOC_BLOB'
,'ID = 1'
,'Upload to Database in progress'
,'Please wait'
,false
,null
/* (clientFile => :upload.file_name
,tableName => 'WU_TEST_TABLE'
,columnName => 'DOC_BLOB'
,whereClause => 'ID = 1'
,progressTitle => 'Upload to Database in progress'
,progressSubTitle=> 'Please wait'
,asynchronous => false
,callbackTrigger => null
if l_success
then
message('File uploaded successfully into the Database');
else
message('File upload to Database failed');
end if;
exception
when others
then
message('File upload failed: '||sqlerrm);
END;
I am able to use the client_to_as_with_progress and as_to_client_with_progress procedures and both work fine.
the way it is setup, the code behind the button to complete the upload calls a procedure in program units "UPLOAD_DB". It seems that the code is not even making it to the procedure because the message I have the upload procedure does not even display.
Thanks
George
Thank you for your help ...but how did you change the call from webutil_db_local to webutil_db ?
can anyone please help for i have the same problem ...
but the strange thing is that files sometimes get uploaded and sometimes they don't ..and as long as the form that i call the upload from is open it causes a block to the table that it used !
Thanks
Kawkaby
Edited by: user7726376 on Dec 3, 2008 6:08 AM
Similar Messages
-
Hi,
I am using the the webutil toolkit to do file transfer to and from the database. The webutil_file_transfer.Client_To_DB_With_Progress with the synchronous mode(i.e. asynchronous FALSE) locks the downloaded file from the database. I want to delete the file when i close the form. But it fails(i used webutil_file.delete_file()). Even the file cannot be deleted using the windows explorer, it says 'File is in use.. sharing violation'. This happens even after closing the form or closing the forms application browser.
Using asychronous solves the issue, but i don't want to use this as i do lot of manipulations to the BLOB before i close the form. Using asynchronous fires the uploading event only during the commit or after the commit which needs the same 'where clause', which is manipulated in our application during the post-forms-commit.
Synchronous method solves the issue but with the downloaded file getting locked. Is there any solution to this. Any help is appreciated.
Thanks
senthaHello,
Any help from Oracle Webutil Team, Duncan, Kavitha...
Any help is appreciated.
thanks
sentha -
Hi,
I am transfering a csv file from the client to the DB and all was working fine, I have not loaded anything new onto my PC though administration may have.
When I attempt to run the procedure that loads the file I now get the error:-
"oracle.forms.webutil.fileTransfer.FileTransfer bean not found. WEBUTIL_FILE_TRANSFER.getMaxTransfer will not work"
I am using WebUtil Version 10.1.2.0
The Java console appears fine :-
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
l: dump classloader list
m: print memory usage
q: hide console
s: dump system properties
t: dump thread list
x: clear classloader cache
0-5: set trace level to <n>
Loading http://carcharodon-cv.bne.marine.csiro.au:8889/forms/java/frmwebutil.jar from JAR cache
Loading http://carcharodon-cv.bne.marine.csiro.au:8889/forms/java/frmall_jinit.jar from JAR cache
RegisterWebUtil - Loading WebUtil Version 10.1.2.0
Loading http://carcharodon-cv.bne.marine.csiro.au:8889/forms/java/jacob.jar from JAR cache
proxyHost=null
proxyPort=0
connectMode=HTTP, native.
Forms Applet version is : 10.1.2.0
Any ideas?Hey, I am having same problem. But I am seeing the below in my JAVA console. Please advice.
Loading http://carcharodon-cv.bne.marine.csiro.au:8889/forms/java/frmwebutil.jar from JAR cache
Loading http://carcharodon-cv.bne.marine.csiro.au:8889/forms/java/frmall_jinit.jar from JAR cache
RegisterWebUtil - Loading WebUtil Version 10.1.2.0
Loading http://carcharodon-cv.bne.marine.csiro.au:8889/forms/java/jacob.jar from JAR cache
All I can see is
proxyHost=null
proxyPort=0
connectMode=HTTP, native.
Forms Applet version is : 9.0.4.0
java.lang.ClassNotFoundException: java.io.IOException: open HTTP connection failed.
at sun.applet.AppletClassLoader.getBytes(Unknown Source)
at sun.applet.AppletClassLoader.access$100(Unknown Source)
at sun.applet.AppletClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at sun.plugin.security.PluginClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at oracle.forms.handler.UICommon.instantiate(Unknown Source)
at oracle.forms.handler.UICommon.onCreate(Unknown Source)
at oracle.forms.handler.JavaContainer.onCreate(Unknown Source)
at oracle.forms.engine.Runform.onCreateHandler(Unknown Source)
at oracle.forms.engine.Runform.processMessage(Unknown Source)
at oracle.forms.engine.Runform.processSet(Unknown Source)
at oracle.forms.engine.Runform.onMessageReal(Unknown Source)
at oracle.forms.engine.Runform.onMessage(Unknown Source)
at oracle.forms.engine.Runform.sendInitialMessage(Unknown Source)
at oracle.forms.engine.Runform.startRunform(Unknown Source)
at oracle.forms.engine.Main.createRunform(Unknown Source)
at oracle.forms.engine.Main.start(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.lang.ClassNotFoundException: java.io.IOException: open HTTP connection failed.
at sun.applet.AppletClassLoader.getBytes(Unknown Source)
at sun.applet.AppletClassLoader.access$100(Unknown Source)
at sun.applet.AppletClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at sun.plugin.security.PluginClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at oracle.forms.handler.UICommon.instantiate(Unknown Source)
at oracle.forms.handler.UICommon.onCreate(Unknown Source)
at oracle.forms.handler.JavaContainer.onCreate(Unknown Source)
at oracle.forms.engine.Runform.onCreateHandler(Unknown Source)
at oracle.forms.engine.Runform.processMessage(Unknown Source)
at oracle.forms.engine.Runform.processSet(Unknown Source)
at oracle.forms.engine.Runform.onMessageReal(Unknown Source)
at oracle.forms.engine.Runform.onMessage(Unknown Source)
at oracle.forms.engine.Runform.sendInitialMessage(Unknown Source)
at oracle.forms.engine.Runform.startRunform(Unknown Source)
at oracle.forms.engine.Main.createRunform(Unknown Source)
at oracle.forms.engine.Main.start(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.lang.ClassNotFoundException: java.io.IOException: open HTTP connection failed.
at sun.applet.AppletClassLoader.getBytes(Unknown Source)
at sun.applet.AppletClassLoader.access$100(Unknown Source)
at sun.applet.AppletClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at sun.plugin.security.PluginClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at oracle.forms.handler.UICommon.instantiate(Unknown Source)
at oracle.forms.handler.UICommon.onCreate(Unknown Source)
at oracle.forms.handler.JavaContainer.onCreate(Unknown Source)
at oracle.forms.engine.Runform.onCreateHandler(Unknown Source)
at oracle.forms.engine.Runform.processMessage(Unknown Source)
at oracle.forms.engine.Runform.processSet(Unknown Source)
at oracle.forms.engine.Runform.onMessageReal(Unknown Source)
at oracle.forms.engine.Runform.onMessage(Unknown Source)
at oracle.forms.engine.Runform.sendInitialMessage(Unknown Source)
at oracle.forms.engine.Runform.startRunform(Unknown Source)
at oracle.forms.engine.Main.createRunform(Unknown Source)
at oracle.forms.engine.Main.start(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.lang.ClassNotFoundException: java.io.IOException: open HTTP connection failed.
at sun.applet.AppletClassLoader.getBytes(Unknown Source)
at sun.applet.AppletClassLoader.access$100(Unknown Source)
at sun.applet.AppletClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at sun.plugin.security.PluginClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at oracle.forms.handler.UICommon.instantiate(Unknown Source)
at oracle.forms.handler.UICommon.onCreate(Unknown Source)
at oracle.forms.handler.JavaContainer.onCreate(Unknown Source)
at oracle.forms.engine.Runform.onCreateHandler(Unknown Source)
at oracle.forms.engine.Runform.processMessage(Unknown Source)
at oracle.forms.engine.Runform.processSet(Unknown Source)
at oracle.forms.engine.Runform.onMessageReal(Unknown Source)
at oracle.forms.engine.Runform.onMessage(Unknown Source)
at oracle.forms.engine.Runform.sendInitialMessage(Unknown Source)
at oracle.forms.engine.Runform.startRunform(Unknown Source)
at oracle.forms.engine.Main.createRunform(Unknown Source)
at oracle.forms.engine.Main.start(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.lang.ClassNotFoundException: java.io.IOException: open HTTP connection failed.
at sun.applet.AppletClassLoader.getBytes(Unknown Source)
at sun.applet.AppletClassLoader.access$100(Unknown Source)
at sun.applet.AppletClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at sun.plugin.security.PluginClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at oracle.forms.handler.UICommon.instantiate(Unknown Source)
at oracle.forms.handler.UICommon.onCreate(Unknown Source)
at oracle.forms.handler.JavaContainer.onCreate(Unknown Source)
at oracle.forms.engine.Runform.onCreateHandler(Unknown Source)
at oracle.forms.engine.Runform.processMessage(Unknown Source)
at oracle.forms.engine.Runform.processSet(Unknown Source)
at oracle.forms.engine.Runform.onMessageReal(Unknown Source)
at oracle.forms.engine.Runform.onMessage(Unknown Source)
at oracle.forms.engine.Runform.sendInitialMessage(Unknown Source)
at oracle.forms.engine.Runform.startRunform(Unknown Source)
at oracle.forms.engine.Main.createRunform(Unknown Source)
at oracle.forms.engine.Main.start(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.lang.ClassNotFoundException: java.io.IOException: open HTTP connection failed.
at sun.applet.AppletClassLoader.getBytes(Unknown Source)
at sun.applet.AppletClassLoader.access$100(Unknown Source)
at sun.applet.AppletClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at sun.plugin.security.PluginClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at oracle.forms.handler.UICommon.instantiate(Unknown Source)
at oracle.forms.handler.UICommon.onCreate(Unknown Source)
at oracle.forms.handler.JavaContainer.onCreate(Unknown Source)
at oracle.forms.engine.Runform.onCreateHandler(Unknown Source)
at oracle.forms.engine.Runform.processMessage(Unknown Source)
at oracle.forms.engine.Runform.processSet(Unknown Source)
at oracle.forms.engine.Runform.onMessageReal(Unknown Source)
at oracle.forms.engine.Runform.onMessage(Unknown Source)
at oracle.forms.engine.Runform.sendInitialMessage(Unknown Source)
at oracle.forms.engine.Runform.startRunform(Unknown Source)
at oracle.forms.engine.Main.createRunform(Unknown Source)
at oracle.forms.engine.Main.start(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.lang.ClassNotFoundException: java.io.IOException: open HTTP connection failed.
at sun.applet.AppletClassLoader.getBytes(Unknown Source)
at sun.applet.AppletClassLoader.access$100(Unknown Source)
at sun.applet.AppletClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at sun.plugin.security.PluginClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at oracle.forms.handler.UICommon.instantiate(Unknown Source)
at oracle.forms.handler.UICommon.onCreate(Unknown Source)
at oracle.forms.handler.JavaContainer.onCreate(Unknown Source)
at oracle.forms.engine.Runform.onCreateHandler(Unknown Source)
at oracle.forms.engine.Runform.processMessage(Unknown Source)
at oracle.forms.engine.Runform.processSet(Unknown Source)
at oracle.forms.engine.Runform.onMessageReal(Unknown Source)
at oracle.forms.engine.Runform.onMessage(Unknown Source)
at oracle.forms.engine.Runform.sendInitialMessage(Unknown Source)
at oracle.forms.engine.Runform.startRunform(Unknown Source)
at oracle.forms.engine.Main.createRunform(Unknown Source)
at oracle.forms.engine.Main.start(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.lang.ClassNotFoundException: java.io.IOException: open HTTP connection failed.
at sun.applet.AppletClassLoader.getBytes(Unknown Source)
at sun.applet.AppletClassLoader.access$100(Unknown Source)
at sun.applet.AppletClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at sun.plugin.security.PluginClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at oracle.forms.handler.UICommon.instantiate(Unknown Source)
at oracle.forms.handler.UICommon.onCreate(Unknown Source)
at oracle.forms.handler.JavaContainer.onCreate(Unknown Source)
at oracle.forms.engine.Runform.onCreateHandler(Unknown Source)
at oracle.forms.engine.Runform.processMessage(Unknown Source)
at oracle.forms.engine.Runform.processSet(Unknown Source)
at oracle.forms.engine.Runform.onMessageReal(Unknown Source)
at oracle.forms.engine.Runform.onMessage(Unknown Source)
at oracle.forms.engine.Runform.sendInitialMessage(Unknown Source)
at oracle.forms.engine.Runform.startRunform(Unknown Source)
at oracle.forms.engine.Main.createRunform(Unknown Source)
at oracle.forms.engine.Main.start(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source) -
How to save pdf file(path) in oracle db
Hi all,
we are using forms 10g. the requirement is user can upload the pdf file from the forms. the pdf file should store in the server folder and the path can store in the db table field. when ever the user wish to download that pdf based up on the unique pdf name that should be open or save on client machine.
can anybody help me how to do this
Thank youHi Amatu Allah,
thank you for your reply
i have the code based upon the webutil functions but it is not working can u pls help me
Here---B8 is Block name
if :toolbar.li_mode in('M') then
if :b8.pdf_loc1 is not null then
declare
l_success boolean;
BEGIN
mesg(1);
l_success := webutil_file_transfer.Client_To_DB_with_progress
(:b8.pdf_loc1-------------------------------------------------------------------------------------source file location,
't002pod_pdf', ---------------------------------------------------------------------------------table name
'pdf',-----------------------------------------------------------------------------------------------column name
'doc_no = :b8.doc_no',---------------------------------------------------------------------doc_no is field
'Upload to Database in progress',
'Please wait',
false,
null
if l_success
then
message('File uploaded successfully into the Database');
else
message('File upload to Database failed');
end if;
exception
when others
then
message('File upload failed: '||sqlerrm);
END;
else
mesg('Plese Select The File name');
go_item('B8.pdf_open');
end if;
end if;
---------------------------------------------------------------------WEBUTIL FUNCTION BODY------------------------------------------------------------------------
FUNCTION Client_To_DB_With_Progress
( clientFile in VARCHAR2,
tableName in VARCHAR2,
columnName in VARCHAR2,
whereClause in VARCHAR2,
progressTitle in VARCHAR2,
progressSubTitle in VARCHAR2,
asynchronous in BOOLEAN default FALSE,
callbackTrigger in VARCHAR2 default NULL) return BOOLEAN is
BEGIN
return UploadInt
( clientFile,
tableName,
columnName,
whereClause,
true,
true,
progressTitle,
progressSubTitle,
asynchronous,
callbackTrigger);
END Client_To_DB_With_Progress;
-- Internal implementations ----
FUNCTION UploadInt ( clientFile in VARCHAR2,
spec1 in VARCHAR2,
spec2 in VARCHAR2,
spec3 in VARCHAR2,
toDB in BOOLEAN,
withProgress in BOOLEAN,
progressTitle in VARCHAR2,
progressSubTitle in VARCHAR2,
asynchronous in BOOLEAN default FALSE,
callbackTrigger in VARCHAR2 default NULL) return BOOLEAN is
clientFileSize PLS_INTEGER := 0;
clientFileChunks PLS_INTEGER := 0;
clientFileInfo VARCHAR2(1000 char);
result BOOLEAN := FALSE;
dataBuffer VARCHAR2(32767);
ignore VARCHAR2(2);
jobj ORA_JAVA.JOBJECT;
lastErrorCode PLS_INTEGER;
lastErrorArgs VARCHAR2(1000);
encodedFile ORA_JAVA.JOBJECT;
ftemp TEXT_IO.FILE_TYPE;
tempFileName VARCHAR2(512);
bool_ignore boolean;
BEGIN
mesg('inside function--2');
-- Client file cannot be null
if clientFile is null then
raise CLIENT_FILE_NULL;
end if;
-- AS file cannot be null. AppsServerFileWriter also handles this. Better to handle here.
if NOT toDB AND spec1 is null then
raise AS_FILE_NULL;
end if;
-- Make sure the client file to be uploaded exists and readable
-- If we don't raise exception here, we end up creating an empty file on DB or AS
if NOT webutil_file.file_is_readable(clientFile)
OR webutil_file.file_is_directory (clientFile) then
raise FILE_NOT_FOUND;
end if;
-- First check to see if a transfer is not currently happening
if In_Progress then
raise AGENT_BUSY;
end if;
-- reset the target
m_toDB := toDB;
-- Set up the file info
clientFileInfo := clientFile||'|0|'||
WEBUTIL_UTIL.BoolToStr(asynchronous,'A|','S|')||
WEBUTIL_UTIL.BoolToStr(withProgress,'Y|','N|')||
progressTitle||'|'||
progressSubTitle;
WebUtil_Core.setProperty(WebUtil_Core.WUT_PACKAGE,'WUT_FILE_INFO', clientFileInfo);
mesg('clietfileinfo: '||clientFileInfo);
-- get the size and chunk info of the client side file
clientFileInfo := WebUtil_Core.getProperty(WebUtil_Core.WUT_PACKAGE,'WUT_FILE_INFO');
clientFileSize := DelimStr.getNumber(clientFileInfo,1,true,'|');
mesg('size: '||clientFileSize);
if clientFileSize = 0 then
raise CLIENT_FILE_EMPTY;
-- no need to close AS file since it is not yet opened.
end if;
clientFileChunks := DelimStr.getNumber(clientFileInfo,2,true,'|');
-- Set up the Open command
if toDB then
if not m_DBEnabled then
raise TRANSFER_FORBIDDEN;
end if;
if not WebUtil_DB_Local.openblob(spec1, spec2, spec3,'W', m_maxTransferSize) then
WebUtil_core.Error(WebUtil_Core.WUT_PACKAGE,WebUtil_DB_Local.getLastError,
'WEBUTIL_FILE_TRANSFER.uploadInt');
raise READWRITE_ERROR;
end if;
else
if not WebUtil_Core.checkJava then
raise NO_JAVA;
end if;
if not checkASACL(spec1,m_writeACL) then
raise TRANSFER_FORBIDDEN;
end if;
jobj := JAVA_APPSERV_WRITER.NEW;
if not JAVA_APPSERV_WRITER.openFile(jobj,spec1) then
lastErrorCode := JAVA_APPSERV_WRITER.getLastError(jobj);
lastErrorArgs := JAVA_APPSERV_WRITER.getLastErrorArgs(jobj) ;
WebUtil_core.Error(Webutil_Core.WUT_PACKAGE,lastErrorCode,
'WEBUTIL_FILE_TRANSFER.uploadInt',lastErrorArgs);
raise READWRITE_ERROR;
end if;
end if;
-- Is this Async? if So we do nothing more here just set the callback and kick it off
if asynchronous then
-- set callbackTrigger even if it is null. we will take care
-- before calling
WebUtil_Core.SetCallbackTrigger(-1,callbackTrigger);
ignore := WebUtil_Core.getProperty(WebUtil_Core.WUT_PACKAGE,'WUT_TRANSFER');
m_chunks := clientFileChunks;
m_fileSize := clientFileSize;
m_uploadSucceeded := NULL;
if not toDB then
m_persistObj := ORA_JAVA.NEW_GLOBAL_REF(jobj);
end if;
result := true;
else
if NOT toDB then
encodedFile := JAVA_FILE.createTempFile('WUAS','.enc');
tempFileName := JAVA_FILE.getPath(encodedFile);
end if;
-- loop through each chunk
for i in 1..clientFileChunks LOOP
dataBuffer := WebUtil_Core.getProperty(WebUtil_Core.WUT_PACKAGE,'WUT_TRANSFER',false);
if (WebUtil_Core.isError) or (dataBuffer is null) then
raise AGENT_BUSY;
end if;
-- Write to the correct place
if toDB then
WebUtil_DB_Local.WriteData(dataBuffer);
else
ftemp := TEXT_IO.FOPEN(tempFileName, 'W');
TEXT_IO.PUT(ftemp, dataBuffer);
TEXT_IO.FCLOSE(ftemp);
-- if not JAVA_APPSERV_WRITER.WriteData(jobj,dataBuffer) then
if not JAVA_APPSERV_WRITER.decodeBASE64File(jobj,tempFileName) then
lastErrorCode := JAVA_APPSERV_WRITER.getLastError(jobj);
lastErrorArgs := JAVA_APPSERV_WRITER.getLastErrorArgs(jobj) ;
WebUtil_core.Error(Webutil_Core.WUT_PACKAGE,lastErrorCode,
'WEBUTIL_FILE_TRANSFER.UploadInt',lastErrorArgs);
raise READWRITE_ERROR;
end if;
end if;
end LOOP;
if toDB then
if WebUtil_DB_Local.CloseBlob(clientFileSize) then
result := true;
else
WebUtil_core.Error(Webutil_Core.WUT_PACKAGE,WebUtil_DB_Local.getLastError,
'WEBUTIL_FILE_TRANSFER.UploadInt');
end if; -- close
else
bool_ignore := JAVA_FILE.DELETE_(encodedFile);
if JAVA_APPSERV_WRITER.CloseFile(jobj,clientFileSize) then
result := true;
else
lastErrorCode := JAVA_APPSERV_WRITER.getLastError(jobj);
lastErrorArgs := JAVA_APPSERV_WRITER.getLastErrorArgs(jobj) ;
WebUtil_core.Error(Webutil_Core.WUT_PACKAGE,lastErrorCode,
'WEBUTIL_FILE_TRANSFER.UploadInt',lastErrorArgs);
raise READWRITE_ERROR;
end if;
end if;
end if; -- async
return result;
EXCEPTION
when CLIENT_FILE_EMPTY then
WebUtil_Core.Error(Webutil_Core.WUT_PACKAGE,133,'WEBUTIL_FILE_TRANSFER.UploadInt', clientFile);
return false;
when CLIENT_FILE_NULL then
WebUtil_Core.Error(Webutil_Core.WUT_PACKAGE,130,'WEBUTIL_FILE_TRANSFER.UploadInt');
return false;
when AS_FILE_NULL then
WebUtil_Core.Error(Webutil_Core.WUT_PACKAGE,117,'WEBUTIL_FILE_TRANSFER.UploadInt');
return false;
when FILE_NOT_FOUND then
WebUtil_Core.Error(Webutil_Core.WUT_PACKAGE,129,'WEBUTIL_FILE_TRANSFER.UploadInt', clientFile);
return false;
when TRANSFER_FORBIDDEN then
WebUtil_Core.Error(Webutil_Core.WUT_PACKAGE,121,'WEBUTIL_FILE_TRANSFER.UploadInt');
return false;
when AGENT_BUSY then
WebUtil_Core.Error(Webutil_Core.WUT_PACKAGE,116,'WEBUTIL_FILE_TRANSFER.UploadInt');
return false;
when READWRITE_ERROR then
return false;
when NO_JAVA then
return false;
when WebUtil_Core.BEAN_NOT_REGISTERED then
WebUtil_Core.ErrorAlert(WebUtil_Core.getImplClass(WebUtil_Core.WUT_PACKAGE)
||' bean not found. WEBUTIL_FILE_TRANSFER.UploadInt will not work');
RAISE FORM_TRIGGER_FAILURE;
when WebUtil_Core.PROPERTY_ERROR then
RAISE FORM_TRIGGER_FAILURE;
END UploadInt; -
Webutil_file_transfer causes blank forms window on second monitor
Hi,
Forms 11.1.2.0.0 64 bit
Java 1.6.0_31
When using webutil_file_transfer.client_to_db_with_progress or db_to_client_with_progress to load/view a document an intermittent fault occurs. If the Forms window is running on a second monitor then the forms window goes blank while the document up/downloads, and does not return unless dragged to the first window. The problem does not occur every time, and never when only one monitor is used. Maximizing the forms window also seems to cure the problem, but this is not a feasible option.
Any help greatly appreciated.
Nick.Hi,
Forms 11.1.2.0.0 64 bit
Java 1.6.0_31
When using webutil_file_transfer.client_to_db_with_progress or db_to_client_with_progress to load/view a document an intermittent fault occurs. If the Forms window is running on a second monitor then the forms window goes blank while the document up/downloads, and does not return unless dragged to the first window. The problem does not occur every time, and never when only one monitor is used. Maximizing the forms window also seems to cure the problem, but this is not a feasible option.
Any help greatly appreciated.
Nick. -
I am trying to import the picture from the client, using WEBUTIL (v 1.0.2)
Procedure looks like:
DECLARE
FILE_NAME VARCHAR2(200);
File_Filter varchar2(30):='JPEG Files (*.jpg)|*.jpg|';
BEGIN
FILE_NAME:=CLIENT_GET_FILE_NAME(NULL,NULL,File_Filter,NULL,OPEN_FILE,TRUE);
CLIENT_IMAGE.READ_IMAGE_FILE(FILE_NAME, 'JFIF',
'<table>.<BLOB column>');
END;
"CLIENT_GET_FILE_NAME" works fine, but when it comes to "CLIENT_IMAGE.READ_IMAGE_FILE" I get message
Checking through the debugger I found that the error is generated in the
WEBUTIL.WEBUTIL_CORE.CHECKJAVA
at the line
classpath := JAVA_SYSTEM.getProperty('java.class.path');
I checked, and all CLASSPATH variables in registry contain the path to webutil.jar
I also tried with: "webutil_file_transfer.Client_To_DB_with_progress"
And it works fine to me, file is transferred to the BLOB field but then I can not display the image in the form. (Is there any advice on how to do this, any example code)
I have been using iDS9.
Is there anyone who could help. Thanks in advance
SeadWhat is really odd to me is the fact that the value in "classpath" after the command
classpath := JAVA_SYSTEM.getProperty('java.class.path');
does not correspond to any variable in the registry.
I searched the registry and the value of the string does not exist in any variable in the registry. I do not know how did "JAVA_SYSTEM.getProperty('java.class.path')" produce the classpath string. -
Error in uploading file using webutil_file_transfer
Hi,
I am using webutil for a forms module which would upload the required file into the database using webutil_file_transfer.client_to_db_with_progress.
I have made the necessary changes to the files webutil.cfg and formsweb.cfg as per the instructions in the webutil documentation.
The error is that the file I am trying to upload doesnt get uploaded.
Following is the code snippet.
DECLARE
l_success BOOLEAN;
BEGIN
l_success :=
webutil_file_transfer.client_to_db_with_progress
(clientfile => :upload.filename,
tablename => 'TBL_UPLOAD',
columnname => 'FILEDATA',
whereclause => 'ID = 1',
progresstitle => 'Upload to Database in progress',
progresssubtitle => 'Please wait...',
asynchronous => FALSE,
callbacktrigger => NULL
commit;
IF l_success
THEN
MESSAGE ('File uploaded successfully into the Database');
ELSE
MESSAGE ('File upload to Database failed' );
END IF;
EXCEPTION
WHEN OTHERS
THEN
MESSAGE ('File upload failed: ' || SQLERRM);
END;I keep getting the message File Upload to Database Failed. The parameter transfer.database.enabled in the file webutil.cfg has also been enabled to TRUE.
I am using Forms 10g, deployed on Red Hat Linux AS 4. The Database is Oracle 10G Release 2.
Any suggestions, clues?
Thanks,
Rishikesh.I have finally got it working.
I copied the version of webutil.pll file from the developer suite onto the server.
This has got it working and the file(s) I am uploading are going through correctly.
I still have one query though. The progress bar which displays the upload progress seems to be in the top left corner of the screen, any parameters we can set so as to get it in the middle of the screen?
Thanks,
Rishikesh -
How to Upload a PDF file into BLOB column in a table using Forms 6i
Can anyone tell me how to upload a PDF file from client and store its content in BLOB column in a table. The file will be genered using reports and win be stored in db.The file to be uploaded will be in client side.
Thank´s.If you are using version 9 or 10 use webutil.... Look in webutil.pll.
Use either one these two fuctions...
FUNCTION Client_To_DB( clientFile in VARCHAR2,
tableName in VARCHAR2,
columnName in VARCHAR2,
whereClause in VARCHAR2,
asynchronous in BOOLEAN default FALSE,
callbackTrigger in VARCHAR2 default NULL) return BOOLEAN;
FUNCTION Client_To_DB_With_Progress
( clientFile in VARCHAR2,
tableName in VARCHAR2,
columnName in VARCHAR2,
whereClause in VARCHAR2,
progressTitle in VARCHAR2,
progressSubTitle in VARCHAR2,
asynchronous in BOOLEAN default FALSE,
callbackTrigger in VARCHAR2 default NULL) return BOOLEAN; -
WEBUTIL: Uploading files with arabic file names to a BLOB column in DB
Hi
I'm using webutil (webutil_file_transfer.client_to_db_with_progress)
to store files in a blob field in a 9i database, I'm doing that using forms 9i.
I'm successful in storing files with English names in the database, however if I want to store a file with an arabic file name , it doesn't get uploaded and the BLOB is empty. Is there any work around to solve this problem.
I tried renaming the arabic file name to an english file name then uploading which was fine, but when I try to rename the file back to arabic, this step fails. I asked a friend and he said that although I'm renaming the file back to arabic in a statment after uploading, that doesn't mean that the upload has finished, i.e the file is still locked for upload that's why I can't rename it back to arabic, I can't rename it even if I try that directly from the operating system.
can anyone help in solving this problem!!
RegardsHi
I'm using webutil (webutil_file_transfer.client_to_db_with_progress)
to store files in a blob field in a 9i database, I'm doing that using forms 9i.
I'm successful in storing files with English names in the database, however if I want to store a file with an arabic file name , it doesn't get uploaded and the BLOB is empty. Is there any work around to solve this problem.
I tried renaming the arabic file name to an english file name then uploading which was fine, but when I try to rename the file back to arabic, this step fails. I asked a friend and he said that although I'm renaming the file back to arabic in a statment after uploading, that doesn't mean that the upload has finished, i.e the file is still locked for upload that's why I can't rename it back to arabic, I can't rename it even if I try that directly from the operating system.
can anyone help in solving this problem!!
Regards -
How to view the pdf files stored in client side using forms 10g
Hi All,
I am using webutil to upload and download the blobs from database. I susccessfully uploaded/downloaded the blobs from database to client(d:\temp.one.pdf)
Now I want to view the download pdf through form.
Can anyone help me regarding this?I have tested the sql and found that there are no records in the table in which iam uploading the file
In the form, I am joing tow tables mapping with rpt_num
Even after adding information for the image table like image_no,image_name and
when i click on upload to db icon. it gives me the same error WUT-113
I think I need to save this basic information first and then upload the file
can you please advise where can i add this code to save the data first
below is the code iam using to upload the file from database
PROCEDURE UPLOAD_DB IS
l_success boolean;
BEGIN
l_success := webutil_file_transfer.Client_To_DB_with_progress
(clientFile => :images.file_name
,tableName => images'
,columnName => 'RPT_IMAGE'
,whereClause => 'RPT_NUM = ''' || :PVT.PVT_SA_RPT_NUM || ''''
,progressTitle => 'Upload to Database in progress'
,progressSubTitle=> 'Please wait'
,asynchronous => false
,callbackTrigger => null
if l_success
then
message('File uploaded successfully into the Database');
else
message('File upload to Database failed');
end if;
exception
when others
then
message('File upload failed: '||sqlerrm);
END; -
The application suspends in webutil file transfer
Dear all,
I have an application that reads pdf files from the harddisk and uploads them to the database using
WEBUTIL_FILE_TRANSFER.CLIENT_TO_DB_WITH_PROGRESS( doc_path_v, table_name_v, 'DOC', 'DOC_ID = ' || doc_id_v,
'Saving the file to the database..', 'Please wait..');
but, when there are a lot of files the application suspends as if the session has expired and I need to log in agnain..
Is there any help with this problem?
thanks.Hi,
sometime it happens with webutil in 10g. I also faced the same problem. If i transfer a big file. Then system
shows the progress bar when progress bar reaches upto 30% then system stops transferring the file. Then
i need to relogin again and when i try to transfer again. It shows one error "Already transfer in progress".
Then i need to kill the session from AS Console.
-Ammad -
Manupulating Excel File Stored In Database
Is there any way I can manipulate the excel file that is stored in the database as LONG RAW ?
I need to allow user to manupulate the excel file that is stored in database and accordingly fetch the specific data from that manipulated Excel File of Database.Your best bet is to keep the data in tables and generate a new excel file each time. Search this forum on how to generate excel files.. Here are three techniques... I like the XML method..
1) OLE2
2) XML
3) CSV
I have also done this using webutil..
1) retrieve excel blob from db to client using webutil function db_to_client_with_progress()
2) manipulate excel file on client using CLIENT_OLE2
3) put excel file back in db using webutil function client_to_db_with_progress()
Sorry.. Just re-read your post and didnt notice the Long-raw part.. :)
Message was edited by:
Mark Reichman -
Hallo,
when i start a filetransfer to DB with CLIENT_TO_DB_WITH_PROGRESS i get
the following message:
ORA-00600: internal error code, arguments: [kpotcpop1],[],[],[],[],[],[],[]
The programcode is:
l_success := webutil_file_transfer.Client_To_DB_with_progress
(clientFile => 'c:\webutil\doc\readme.html'
,tableName => 'WU_TEST_TABLE'
,columnName => 'BLOB'
,whereClause => 'ID = 1'
,progressTitle => 'Upload to Database in progress'
,progressSubTitle=> 'Please wait'
,asynchronous => false
,callbackTrigger => null
What have i make bad.
regards
Harald ReinholzDid you try with the webutil demo - just to make sure all the set up is working ok?
Regards
Grant Ronald
Forms Product Management -
Store File as .xml using standalone="yes"
Hello i have a working scenario which creates an .xml from a purchase order. The encoding ist UTF-8.
What i am missing is the standalone="yes" in the <xml-tag>. How can i get this optional attribute into my created xml?
Help is greatly appreciated. Thank you in advance.
Regards SimonUse webutil_file_transfer.Client_To_DB_with_progress.
There is no method AS to DB, but you can build it by yourself looking into the code done in client_to_as and client_to_db -
Hi,
I have an Oracle Forms Application that generates an Excel file, and I need do transform the Excel file generated in a blob type. I generate the Excel file with Ole2 package, with the following code:
OLE2.INVOKE(WORKBOOK,'SaveAs',FILENAME);
How can I save the Excel file generated in a blob variable?
Thanks,
Muriloif you are using webutil have a look at...
FUNCTION Client_To_DB( clientFile in VARCHAR2,
tableName in VARCHAR2,
columnName in VARCHAR2,
whereClause in VARCHAR2,
asynchronous in BOOLEAN default FALSE,
callbackTrigger in VARCHAR2 default NULL) return BOOLEAN is
...or...
FUNCTION Client_To_DB_With_Progress
( clientFile in VARCHAR2,
tableName in VARCHAR2,
columnName in VARCHAR2,
whereClause in VARCHAR2,
progressTitle in VARCHAR2,
progressSubTitle in VARCHAR2,
asynchronous in BOOLEAN default FALSE,
callbackTrigger in VARCHAR2 default NULL) return BOOLEAN is
And after looking at your code it appears that you are not using webutil. So, here is how to load a blob from a bfile and many other blob manipulations..
http://download-east.oracle.com/docs/cd/B14117_01/appdev.101/b10796/adlob_da.htm
Maybe you are looking for
-
Error while maintaining a table in SM30
Hi experts, Im getting the following error when trying to add entries (Maintain) in table T5ASRAUTHMETHOD in SM30 transaction. The error is " The maintenance dialog foor T5ASRAUTHMETHOD is incomplete or not defined". Pls tell me how to correct this
-
Unable to play Cineform avi files in Premiere Pro CS3
I am using Cineform NeoHD version 5.3.2 to convert the MXF files from my Canon XF300 into Cineform AVI. Then I import these AVI files into Premiere Pro CS3 and here is where the problem begins. Premiere is unable to play these Cineform files. All I g
-
General Ledger report with Op Bal , Trans Line Items and Closing Balance
Hi Experts, My clients needs a General Ledger report which should show Opening balance and all transactions line items with closing figure in a single report for a fiscal year in the given date range wise. Can I get a report in standard sap. Waiting
-
How to open a .mrc file?
I need to download an order report from a vendor site (Ingram Books). The file has a .mrc extension. I have been unable to find a application that will open this file. Any suggestions?
-
Print Server does not show local USB printers (OS Server 10.3.9)
I have mac OS X 10.3 server sharing my local USB printer for over more than 18 months, suddently on Jan 6th 2007, my server refused to see them in the Print Services in the Admin tool. The last log I got from starting it is on jan 5th: 2007-01-05 16: