Home » Developer & Programmer » Forms » Transferring a text file from a windows PC to a Unix server
Transferring a text file from a windows PC to a Unix server [message #183479] Fri, 21 July 2006 02:31 Go to next message
tumediso
Messages: 3
Registered: April 2005
Junior Member
Hi,
I am trying to write a pl/sql program that sends a file from a windows PC to a Unix server on the network. I have encountered an exception and am not able to figure out the problem. the exception is: Oracle: ORA-22285: non-existent directory or file.

Below is the code that I am using. It uses a user-defined package that also depends on the UTL_TCP, UTL_FILE, DBMS_LOB & STANDARD packages.

PROCEDURE Server_Connect IS

l_conn UTL_TCP.Connection;


BEGIN
Message('0');
l_conn := Stud.Upload_File.Login('168.167.8.23', '21', 'tumediso', 'p1fel0');

-- Message('1');
Stud.Upload_file.Binary(l_conn);
-- Message('2');
Stud.Upload_File.Put(l_conn, 'C:/Packages/', 'test.txt', '/its/tumediso/test_put.txt');
-- Message('3');
Stud.Upload_file.Logout(l_conn);
-- Message('4');
UTL_TCP.Close_All_Connections;


It actually fails at line:
Stud.Upload_File.Put(l_conn, 'C:/Packages/', 'test.txt', '/its/tumediso/test_put.txt');


Does anyone know where the prblem could be. All the specified files and directoty do exist on the two computers.
Re: Transferring a text file from a windows PC to a Unix server [message #183492 is a reply to message #183479] Fri, 21 July 2006 02:52 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
An Oracle directory is on the SERVER. You cannot use local (client-side) directories.

MHE
Re: Transferring a text file from a windows PC to a Unix server [message #183503 is a reply to message #183492] Fri, 21 July 2006 03:23 Go to previous messageGo to next message
tumediso
Messages: 3
Registered: April 2005
Junior Member
I intended /its/tumediso/test_put.txt to be the path to the target file on the Unix server. The local directory is the other one, C:/packages/.

Are you saying for it to work I have to use oracle directories on the target server?

And what about the syntax of the directory path to access the Unix server? Is it okay the way I have it?

Thanks again for your time.
Re: Transferring a text file from a windows PC to a Unix server [message #183517 is a reply to message #183503] Fri, 21 July 2006 03:48 Go to previous message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
First you have to create directory objects. These point to OS directories. Look at the CREATE DIRECTORY command. Afterwards, you can use these directory objects.

MHE
Previous Topic: Trapped duplicate record but "Do you want to save changes?" message appears
Next Topic: if record cancel mark strikethrough
Goto Forum:
  


Current Time: Fri Sep 20 12:27:30 CDT 2024