| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.misc -> Re: OWA Replacement Cartridge
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.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~4html_page:
htp.formOpen( 'reading_procedure',
'post',
null,
'multipart/form-data');
htp.formSubmit('operacio',llegir_client.importar_str);--msg.msg());
htp.print('<INPUT TYPE="FILE" NAME="P_FILE" SIZE="40">');
htp.formClose;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
reading_procedure:
if ( owa_util.get_cgi_env('HTTP_CONTENT_TYPE') not like
'multipart/form-data;%' )
then
raise_application_error( -20666,
'Sorry, Only Netscape 2.x/3.x can
currently upload documents' );
return NULL;
[Apps]
DBAUTH $OWAREPLPATH$/owarepl/src/owarepl.so owarepl_entry 0 [AppDirs] /bddevf DBAUTH /u/oracle/ows2/bin [DBAUTH] owa.cfg = /u/oracle/ows2/admin/owa.cfg server.cfg = /u/oracle/ows2/admin/sv<dcd>.cfg authenticate = another_web_agent web_authent_prefix = web$ dirSeparator = /
This is an example of how to use it. The default
NAME_OF_TABLE_WHERE_TO_INSERT_FILE_CONTENTS is
'image', but you can put any name as far as youi modify the sv<dcd>.app
file.
create table NAME_OF_TABLE_WHERE_TO_INSERT_FILE_CONTENTS
(
NAME VARCHAR2(255), MIME_TYPE VARCHAR2(30), IMG_SIZE NUMBER, IMAGE LONG RAW,constraint image_pk primary key( name ) )
IF '0'<=c AND c<='9' THEN
RETURN ascii(c)-ascii('0');
ELSE
--ABCDEF -> 10..16
RETURN ascii(c)-ascii('A')+10;
END IF;
return chr( 16*hex2dec2(substr(str,1,1)) +
hex2dec2(substr(str,2,1)));
--Transformem
--si no troba fitxer--> retorna NULL
--------------------------
IS
vc varchar2(32767):='';
j number;
vc:='';
--image ocupa 2*img_size (2bytes per caracter)
for j in 0..(i.img_size-1) LOOP
vc:=vc||hex2dec(substr(i.image,j*2+1,2));
end loop;
DELETE FROM client_f WHERE name=nom;
RETURN vc;
>
> It would be real helpful if someone could send sample pl/sql code that
> is being used to do this via Netscape.
There's also an example at owarepl/sql/image.sql
Hope this helps
Dani Pinol Received on Wed Jul 09 1997 - 00:00:00 CDT
![]() |
![]() |