Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to Setup FTP-Over-HTTP Proxy

999620Jul 11 2016 — edited Jul 12 2016

Hello.

In the documentation for UTL_HTTP, it states that FTP requests are supported by using an HTTP proxy server:

"Other Internet-related data-access protocols (such as the File Transfer Protocol (FTP) or the Gopher protocol) are also supported using an HTTP proxy server that supports those protocols."

Is there a proxy service available that will translate my HTTP request to the FTP server?  All I am trying to do is figure out a way to check if specific files exist on an FTP server, using read-only anonymous permissions.  So I want to use the following code to check for the existence of a file, using 'ftp://' instead of 'http://'.  A browser that download the file.  Windows Explorer can download the file.  Why can I not get PL/SQL to download the file, or atleast check to see if it's there?  I'm trying to avoid using a thirdparty PL/SQL package.

DECLARE

  url       VARCHAR2(256) := 'ftp://myftp.myftpserver.com/pub/test.txt';

  username  VARCHAR2(256);

  password  VARCHAR2(256);

  req       UTL_HTTP.REQ;

  resp      UTL_HTTP.RESP;

BEGIN

  req := UTL_HTTP.BEGIN_REQUEST(url);

  IF (username IS NOT NULL) THEN

    UTL_HTTP.SET_AUTHENTICATION(req, username, password);

  END IF;

  resp := UTL_HTTP.GET_RESPONSE(req);

  DBMS_OUTPUT.PUT_LINE('response -->' || resp.status_code);

END;

Please let me know what proxy service I need to install and how it should be configured.  Otherwise, is there a simple way for me to check the existence of files on an FTP server without the installation of a thirdparty library?

Thanks!

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 9 2016
Added on Jul 11 2016
10 comments
1,901 views