Question

I'm trying to upload a file via ftp from a file system, I can connect without issue using the example of this ad http://www.oracle-base.com/articles/misc/ftp-from-plsql.php and I managed to perform the connection but when I upload the file I mark error 550 file not found, I suppose that is why I am putting urls in the program because I am from oracle xe windows.

Does anyone know if I'm putting the url properly? or what am I doing wrong?

here is my code:

DECLARE
    l_conn  UTL_TCP.connection;
BEGIN 
    l_conn := ftp.login('IPADDRES', '21', 'USR', 'PWD');
    ftp.binary(l_conn);
    ftp.get(l_conn,
      'C:\oraclexe\app\oracle\files\file.pdf',
      'C:\FTP\files',
      'file.pdf');
    ftp.logout(l_conn);
END;

No correct solution

OTHER TIPS

From the documentation you refer to, the remote directory where you will upload the file must be an Oracle directory.

  • create directory on the remote database
    SQL> CREATE OR REPLACE public DIRECTORY MY_DOCS as 'C:\FTP\files';
  • then only you will be able to use it as intended:
    ftp.get(
      p_conn      => l_conn,
      p_from_file => 'C:\oraclexe\app\oracle\files\file.pdf',
      p_to_dir    => 'MY_DOCS',
      p_to_file   => 'file.pdf');
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top