1 Reply Latest reply: Dec 30, 2013 1:05 PM by Mike Kutz RSS

    Upload/Download txt file from an Oracle Directory

    997998

      Hello there,

       

      I'm an Oracle APEX Developer and i'm having a problem calling a txt file from my Oracle directory (reads my server physical path) through APEX (i'm using version 4.2.1).

      More specifically, i own a package including 2 procedures

      - one for creating a string and inserting it on a table column

      - and a second one that uses the UTL_FILE package for creating an ASCII file (something.txt) from the column above and storing it in my Directory.

      Both procedures work just fine: The string is created, then inserted in the table and my ASCII txt file, has been stored in my Directory.

      The part i have not yet developed, being the download of this txt file through an apex page. I cannot use the item 'File Browse' as it requires a blob column existence.

      I have also tried the 'wpg_docload.download_file' function like but still not working:

       

       

              OWA_UTIL.mime_header (NVL (l_mime_type, 'text/plain'), FALSE);

              htp.p('Content-Disposition: filename="MYDIR\something.txt"') ;

              htp.p('Content-Length: ' || dbms_lob.getlength('MYDIR\something.txt')) ;

              owa_util.http_header_close;

              wpg_docload.download_file('MYDIR\something.txt');

       

      Any suggestions to directly call my *.txt file??

       

      Thanks in advance,

      Sophie