Skip to Main Content

APEX

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!

Upload/Download txt file from an Oracle Directory

User_J2F0LDec 30 2013 — edited Dec 30 2013

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

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 27 2014
Added on Dec 30 2013
1 comment
648 views