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: OWA Replacement Cartridge

Re: OWA Replacement Cartridge

From: <edwards_at_garland.dnr.state.sc.us>
Date: 1997/07/08
Message-ID: <33C23078.446B@garland.dnr.state.sc.us>#1/1

Dwayne A. Gaither wrote:
>
> I am trying to use the OWA replacement cartridge to upload and
> download image files from a oracle table. So far, I have been
> unsuccessful.
>
> It would be real helpful if someone could send sample pl/sql code that
> is being used to do this via Netscape.
>
> Also, if you are using the replacement cartridge, why do you have to
> use CGI. If anyone has any good instructions on how this cartridge is
> installed and loaded that would be helpful as well. I am running
> Oracle 7.33 on NT 4.0 and I have Webserver 2.1
>
> Any help is greatly appreciated. THanks.
>
> --Dwayne A. Gaither--
> dagaith_at_mindspring.com

Here is a procedure that I use to let users upload their 'comments' on a permit application into ORACLE from netscape.

        Two important things to know are that the cartridge saves all files uploaded into a table called 'IMAGE'. So your procedure will need permission to select,update,delete from this table. And the file uploaded will be given a unique name by the cartridge. This name will be passed to your procedure in the paramater 'p_file'.

        What I've done in this procedure is extract the file out of the 'IMAGE' table and then save it in my own table 'COMMENTS'

procedure upload(paction in varchar2,ppermit in varchar2, psection in varchar2,p_file in varchar2)
is
cursor comment_cur is

    select * from image where name = p_file; begin

    htp.htmlopen;

    for comment_rec in comment_cur loop
    insert into comments(permit,section,comments)

        values(ppermit,psection,comment_rec.image);     delete from image where name = p_file;     end loop;

    htp.prn('comments for '||ppermit||' '||psection);
    htp.prn('<br> added');
    htp.htmlclose;

end upload;

this procedure is called by this HTML form:

<html>
<form action = "hostname/wa/dcd_name/owa/upload" method = "POST" enctype = "multipart/form-data">

<input type = "text" name = "ppermit">
<input type = "file" name = "p_file">
<input type = "text" name = "psection">
<input type = "submit" name = "paction" value = "UPLOAD">
</form>
</html>

Hope this helps

	Steve Edwards
	SCDNR
Received on Tue Jul 08 1997 - 00:00:00 CDT

Original text of this message

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