Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: trying to output to file via web using PL/SQL

Re: trying to output to file via web using PL/SQL

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Wed, 02 Sep 1998 15:23:55 GMT
Message-ID: <35f662b8.9002424@192.86.155.100>


A copy of this was sent to Eric Schlene <eschlene_at_purdue.edu> (if that email address didn't require changing) On Tue, 01 Sep 1998 17:01:31 -0500, you wrote:

>I'm having a nightmare trying to get this to work. I've had some
>direction from this NG but with no sucess. so I apologize for hitting
>you all up again for help...but here goes.
>
>I need to send PL/SQL output via the Oracle Web Server to an end user's
>workstation. I'd like to use the browser to do this, triggering via
>PL/SQL the "save-as" dialog box on the browser. I've tried a half dozen
>different approaches, even trying to, as advised on the NG, trick the
>browser into thinking this is a specific file using a package/procedure
>name (e.g., fileit.txt).
>
>In any case, here's what I've got. I've left the three
>owa_util.mime_header calls in place with comments as to what results I
>get from each. My browser's application settings are set to interpret
>MIME text/Save-As as a write to disk call.
>

The issue is that the pl/sql cartridge will not (cannot) send back a mime type that the web LISTENER is not set up to recognize. text/plain and text/html work because the svXXXX.cfg (xxxx = name of your listener) file has those mime types listed in the [MimeTypes] section.

If you configure the listener to allow for 'text/save-as' as a valid mime type -- this will work.

>Any help on this would be greatly appreciated.
>
>Eric Schlene
>
>------------------------
>
>CREATE OR REPLACE PACKAGE BODY fileit AS
> PROCEDURE txt IS
> v_func VARCHAR2(10000);
> BEGIN
> owa_util.mime_header( 'text/save-as' ); -- gives document contains
>no data
>-- owa_util.mime_header( 'text/plain' ); -- lines as entered, +
><BODY> and </BODY>
>-- owa_util.mime_header( 'text/html' ); -- html formatted text
>w/o <BODY>...
> htp.BodyOpen;
> v_func := '
>This is a test 01
>This is a test 02
>This is a test 03
>This is a test 04
>This is a test 05
>This is a test 06
> ';
> htp.Print(v_func);
> htp.BodyClose;
> END;
>END;
>/
>
>
 

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Herndon VA

--
http://govt.us.oracle.com/ -- downloadable utilities  



Opinions are mine and do not necessarily reflect those of Oracle Corporation  

Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Wed Sep 02 1998 - 10:23:55 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US