Home » Developer & Programmer » Forms » Copy file using oracle forms 6i (database 11g, oracle forms 6i.)
Copy file using oracle forms 6i [message #676189] Mon, 20 May 2019 06:58 Go to next message
asifcs
Messages: 21
Registered: May 2019
Location: pakistan
Junior Member

hi guys,
I want to download a file from network location on a client pc using forms 6i. On the same machine where network location exist it works fine. But at client it does't work and display message exist in "if not form_success then" . Below is my code please check and make corrections. thanks.

declare
	filename varchar2(500);
	filename2 varchar2(500);
	v_dest_path varchar2(500);
begin	
	filename := :admin_attachments.ATTACHED_FILE;
	filename2 := substr(filename, (instr(filename,'\',-1,1)+1));
	v_dest_path := 'C:\Users\';
 if filename2 is not null then	--run only when file select 
	host('cmd /c copy '||filename||' '||v_dest_path||filename2, no_screen);
	if not form_success then
		message('Error--Can Not copy Check Path.',no_screen);
		message('Error--Can Not copy Check Path.',no_screen);
		else
		Message('File downloaded Successfully. Check Location "C:\Users"'||filename2);
		Message('File downloaded Successfully. Check Location "C:\Users"'||filename2);
		--Commit_form;
	end if;
end if;	

End;
*BlackSwan added {code} tags. Please do so yourself in the future.
How to use {code} tags and make your code easier to read

[Updated on: Mon, 20 May 2019 07:17] by Moderator

Report message to a moderator

Re: Copy file using oracle forms 6i [message #676191 is a reply to message #676189] Mon, 20 May 2019 07:20 Go to previous messageGo to next message
cookiemonster
Messages: 13917
Registered: September 2008
Location: Rainy Manchester
Senior Member
asifcs wrote on Mon, 20 May 2019 12:58
On the same machine where network location exist it works fine. But at client it does't work
So the client machines can't access the network location?
At the end of the day you need to check what you're passing to host and see if you can run the same command directly on a command prompt on the machine in question.

If you can't you aren't going to get forms to do it.
Re: Copy file using oracle forms 6i [message #676201 is a reply to message #676191] Mon, 20 May 2019 12:04 Go to previous message
asifcs
Messages: 21
Registered: May 2019
Location: pakistan
Junior Member

Thanks, The error was due to permissions.
Previous Topic: LOV Button
Next Topic: semicolon " : " in oracle forms
Goto Forum:
  


Current Time: Thu Mar 28 09:16:52 CDT 2024