Home » Developer & Programmer » Forms » upload/Copy file using forms 6i. (forms 6i, Database 11g, OS windows server 2012.)
upload/Copy file using forms 6i. [message #677592] Sun, 29 September 2019 01:37 Go to previous message
asifcs
Messages: 21
Registered: May 2019
Location: pakistan
Junior Member

HI, Following is my code for copying/uploading a file from client to server machine using forms 6i. works fine for me, only problem is that while I spaces in file name or any folder name having spaces in path it give me error. Please update my code as if there is a space in file name such file could be uploaded/copied.
here is my code.
declare
filename varchar2(500);
filename2 varchar2(500);
v_source_path varchar2(500);
begin
filename := GET_FILE_NAME(DIRECTORY_NAME=>:global.pth,File_Filter=>'PDF FILES (*.pdf)|*.PDF|',dialog_type=>Open_File);
filename2 := substr(filename, (instr(filename,'\',-1,1)+1));
v_source_path := '\\Server-pc\filesData\Attached_Files\ora_files\';
if filename2 is not null then --run only when file select
host('cmd /c copy '||filename||' '||v_source_path||filename2, no_screen);
:profile.Attach_File :=v_source_path||filename2;
if not form_success then
message('Error--Can Not copy Check Path.',no_screen);
message('Error--Can Not copy Check Path.',no_screen);
:profile.attach_file:=null;
else
Message('File Copied Successfully.');
Commit_form;
end if;
end if;

End;
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Webutil in forms 12c
Next Topic: CALCULATE TIME
Goto Forum:
  


Current Time: Wed May 08 18:56:23 CDT 2024