Home » Developer & Programmer » Forms » WEBUTIL_FILE_TRANSFER (forms migration to 10g )
WEBUTIL_FILE_TRANSFER [message #378749] |
Thu, 01 January 2009 03:46 |
sirivijay
Messages: 48 Registered: October 2008
|
Member |
|
|
Hi,
we are migrating forms 6i to 10g..we need to upload contents of a file to database..this was working fine where app server and dev suite are on single machine..If we want to do it with a separate apps server before uploading to database the file is to be transfered from client to a folder in server and then upload asusual..i came to know abt this function .. WEBUTIL_FILE_TRANSFER.CLIENT_TO_AS_WITH_PROGRESS()
not knowing how to code it exactly..can any 1 tell me the code to use it if my source file is in c:/devsuit/forms/xx.out and to transfer to c:/devsuit/forms/datafile/xx.out. and delete this file from temp folder after uploading
|
|
|
|
Re: WEBUTIL_FILE_TRANSFER handling errors [message #421465 is a reply to message #379804] |
Tue, 08 September 2009 07:34 |
ilikeorange
Messages: 3 Registered: September 2009
|
Junior Member |
|
|
Hi,
I use a similar coding to download a pdf report from App server to client.
lv_ret := WEBUTIL_FILE_TRANSFER.AS_To_Client_with_progress(lv_clnt_file, lv_srvr_file,
'Download from Application Server in progress', 'Please wait');
IF lv_ret = TRUE THEN
--Open the file from client machine
Web.Show_Document('file://'||lv_clnt_file,'_blank');
ELSE
PROC_SHOW_ALERT('ERROR','REPORT ERROR','Error in generating Rating Reports',lv_alrt_bttn);
END IF;
Is there anyway to catch the WUT error in particular (e.g error due to not enough space in H:\) from my oracle forms? Please explain.
|
|
|
|
|
|
Re: WEBUTIL_FILE_TRANSFER [message #435416 is a reply to message #378749] |
Wed, 16 December 2009 03:23 |
dayang_aziz@yahoo.com
Messages: 19 Registered: August 2009
|
Junior Member |
|
|
Hello,
I got error when try to upload few file at one time.
Here is the error WUT - 116. From the help it asks to Check that one transfer is complete before starting the next.
My question is how to check that.
Here is my procedure.
PROCEDURE PR_INS_ATT(NEW_ATT varchar2) IS
att_id2 number;
result boolean :=false;
RESULT2 boolean :=false;
att_path2 varchar2 (1000);
DIR_SUCCESS BOOLEAN :=false;
ISR_DIRECTORY VARCHAR2 (200);
ISR_DIR2 VARCHAR2 (200);
mkdirc_path2 VARCHAR2 (200);
mkdirc_name2 varchar2(50);
cd_test varchar2(200);
s_FILE_PATH varchar2(200);
s_NEW_ATT varchar2(100);
BEGIN
select isr_dir, mkdirc_path, mkdirc_name
into ISR_DIR2, mkdirc_path2, mkdirc_name2
from isr_info;
ISR_DIRECTORY := (ISR_DIR2||:ISR_MAIN.INC_NUM) ;
cd_test := 'cd '||mkdirc_path2||'; '||mkdirc_name2||' INC'||:ISR_MAIN.INC_NUM||'';
HOST(cd_test);
Synchronize;
case
when NEW_ATT = 'NEW_ATT1'
then s_NEW_ATT := :isr_main.new_att1;
s_FILE_PATH := :PARAMETER.FILE_PATH1;
message(s_FILE_PATH);
message(s_FILE_PATH);
when NEW_ATT = 'NEW_ATT2'
then s_NEW_ATT := :isr_main.new_att2;
s_FILE_PATH := :PARAMETER.FILE_PATH2;
message(s_FILE_PATH);
message(s_FILE_PATH);
when NEW_ATT = 'NEW_ATT3'
then s_NEW_ATT := :isr_main.new_att3;
s_FILE_PATH := :PARAMETER.FILE_PATH3;
when NEW_ATT = 'NEW_ATT4'
then s_NEW_ATT := :isr_main.new_att4;
s_FILE_PATH := :PARAMETER.FILE_PATH4;
else
s_NEW_ATT := :isr_main.new_att5;
s_FILE_PATH := :PARAMETER.FILE_PATH5;
end case;
select (max(att_id)+1) into att_id2
from isr_att
where inc_num =:ISR_MAIN.INC_NUM;
if att_id2 is null then
att_id2 :=01;
end if;
message(s_FILE_PATH);
message(s_FILE_PATH);
-- att_path2 := (ISR_DIRECTORY||'/'||att_id2||''||:isr_main.new_att||'');
att_path2 := (ISR_DIRECTORY||'/'||att_id2||''||s_NEW_ATT||'');
SYNCHRONIZE;
/* RESULT := webutil_file_transfer.client_to_as_with_progress
( :parameter.FILE_PATH
, att_path2
, 'Proses Muatnaik'
,'ke'
, TRUE
, null );*/
RESULT := webutil_file_transfer.client_to_as_with_progress
( s_FILE_PATH
, att_path2
, 'Proses Muatnaik'
,'ke'
, TRUE
, null );
SYNCHRONIZE;
RESULT2 := webutil_file_transfer.asynchronous_upload_success;
SYNCHRONIZE;
--IF RESULT2 then
--webutil_host.
insert into ISR_ATT(att_id, inc_num, att_date, att_by, att_details, att_path)
values(att_id2, :ISR_MAIN.INC_NUM, sysdate, :parameter.P_LOGIN_USER, s_NEW_ATT, att_path2);
commit;
--:isr_main.new_att := null;
commit_form;
END;
Here is how I call the procedure.
if :isr_main.new_att1 is not null then
PR_INS_ATT('NEW_ATT1');
end if;
if :isr_main.new_att2 is not null then
PR_INS_ATT('NEW_ATT2');
end if;
if :isr_main.new_att3 is not null then
PR_INS_ATT('NEW_ATT3');
end if;
if :isr_main.new_att4 is not null then
PR_INS_ATT('NEW_ATT4');
end if;
if :isr_main.new_att5 is not null then
PR_INS_ATT('NEW_ATT5');
end if;
There was only one file could be transfer when I save.
For info records were inserted in my table but only one file transfered.
Any suggestion is much appreciated.
Thanks and regards,
dayang [EDITED by DJM: change quote tags to code tags]
[Updated on: Tue, 05 January 2010 22:29] by Moderator Report message to a moderator
|
|
|
Re: WEBUTIL_FILE_TRANSFER [message #436503 is a reply to message #435416] |
Wed, 23 December 2009 19:47 |
dayang_aziz@yahoo.com
Messages: 19 Registered: August 2009
|
Junior Member |
|
|
Hi,
One of my friend told me to do looping to check if the file has been transferred or not. So I modify the code to this.
PROCEDURE PR_INS_ATT(NEW_ATT varchar2) IS
att_id2 number;
result boolean :=false;
--RESULT2 boolean :=false;
att_path2 varchar2 (1000);
DIR_SUCCESS BOOLEAN :=false;
ISR_DIRECTORY VARCHAR2 (200);
ISR_DIR2 VARCHAR2 (200);
mkdirc_path2 VARCHAR2 (200);
mkdirc_name2 varchar2(50);
cd_test varchar2(200);
s_FILE_PATH varchar2(200);
s_NEW_ATT varchar2(100);
BEGIN
select isr_dir, mkdirc_path, mkdirc_name
into ISR_DIR2, mkdirc_path2, mkdirc_name2
from isr_info;
ISR_DIRECTORY := (ISR_DIR2||:ISR_MAIN.INC_NUM) ;
cd_test := 'cd '||mkdirc_path2||'; '||mkdirc_name2||' INC'||:ISR_MAIN.INC_NUM||'';
HOST(cd_test);
Synchronize;
case
when NEW_ATT = 'NEW_ATT1'
then s_NEW_ATT := :isr_main.new_att1;
s_FILE_PATH := :PARAMETER.FILE_PATH1;
message(s_FILE_PATH);
message(s_FILE_PATH);
when NEW_ATT = 'NEW_ATT2'
then s_NEW_ATT := :isr_main.new_att2;
s_FILE_PATH := :PARAMETER.FILE_PATH2;
message(s_FILE_PATH);
message(s_FILE_PATH);
when NEW_ATT = 'NEW_ATT3'
then s_NEW_ATT := :isr_main.new_att3;
s_FILE_PATH := :PARAMETER.FILE_PATH3;
when NEW_ATT = 'NEW_ATT4'
then s_NEW_ATT := :isr_main.new_att4;
s_FILE_PATH := :PARAMETER.FILE_PATH4;
else
s_NEW_ATT := :isr_main.new_att5;
s_FILE_PATH := :PARAMETER.FILE_PATH5;
end case;
select (max(att_id)+1) into att_id2
from isr_att
where inc_num =:ISR_MAIN.INC_NUM;
if att_id2 is null then
att_id2 :=01;
end if;
-- att_path2 := (ISR_DIRECTORY||'/'||att_id2||''||:isr_main.new_att||'');
att_path2 := (ISR_DIRECTORY||'/'||att_id2||''||s_NEW_ATT||'');
BEGIN
message(att_path2);
message(att_path2);
RESULT := webutil_file_transfer.client_to_as_with_progress
( s_FILE_PATH
, att_path2
, 'Proses Muatnaik'
,'ke'
, TRUE
, null );
SYNCHRONIZE;
IF RESULT = true THEN
message('done trnasfer');
message('done trnasfer');
RESULT := false;
insert into ISR_ATT(att_id, inc_num, att_date, att_by, att_details, att_path)
values(att_id2, :ISR_MAIN.INC_NUM, sysdate, :parameter.P_LOGIN_USER, s_NEW_ATT, att_path2);
commit;
RETURN;
ELSE
PR_INS_ATT(NEW_ATT);
END IF;
EXCEPTION WHEN OTHERS THEN
message('error');
message('error');
END;
END;
Both file could be transferred. However the first file is 0 byte and I got this error WUT-125 which I checked in Help it says:
Quote:Checksum error closing file on application server. Type: User Description: When an upload to the application server completed the file size was not the value expected. Resolution: Retry the upload operation and check for sufficient disk space / access on the middle tier
For info, I tried to use the same code and trigger the procedure from a button for each file. All files could be transferred successfully.
Could anyone help me regarding this.
Any suggestion is much appreciated.
Thanks and regards,
Dayang [EDITED by DJM: change quote tags to code tags]
[Updated on: Tue, 05 January 2010 22:30] by Moderator Report message to a moderator
|
|
|
|
|
Re: WEBUTIL_FILE_TRANSFER [message #438949 is a reply to message #437746] |
Wed, 13 January 2010 03:10 |
dayang_aziz@yahoo.com
Messages: 19 Registered: August 2009
|
Junior Member |
|
|
Hi,
Thanks David for the info. I was not yet try to use WebUtil_File_Transfer_IsASWritable since I succeed transferred the file using webutil_file_transfer.client_to_as_with_progress.
May I jump to conclusion that multiple transfers are not allow using webutil? So that I can say it is the limitation of the application. So that user should upload the file one by one.
Here in my webutil.cfr configuration:
transfer.appsrv.enabled=TRUE
transfer.appsrv.accessControl=FALSE
When I changed transfer.appsrv.accessControl=TRUE , I still got the same error.
If I throw 'message;pause;', how can I make sure that the previous transfer already success since that it return true already at the first transfer. Then, when should I resume the program.
Thanks & regards,
Dayang
|
|
|
Re: WEBUTIL_FILE_TRANSFER [message #439067 is a reply to message #438949] |
Wed, 13 January 2010 23:03 |
|
djmartin
Messages: 10181 Registered: March 2005 Location: Surges Bay TAS Australia
|
Senior Member Account Moderator |
|
|
Your code contains IF RESULT = true THEN
message('done trnasfer');
message('done trnasfer');
RESULT := false;
insert into ISR_ATT(att_id, inc_num, att_date, att_by, att_details, att_path)
values(att_id2, :ISR_MAIN.INC_NUM, sysdate, :parameter.P_LOGIN_USER, s_NEW_ATT, att_path2);
commit;
RETURN;
ELSE
PR_INS_ATT(NEW_ATT);
END IF;
Why not have a 'pause' after the 'message' so that the user has to press 'enter' to go to the next file for transfer and why do you have "PR_INS_ATT(NEW_ATT);" hwne the transfer fails? Why not tell the user that the transfer failed?
David
|
|
|
Goto Forum:
Current Time: Tue Feb 04 04:57:26 CST 2025
|