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

Home -> Community -> Usenet -> c.d.o.server -> Re: upload file into oracle throug www

Re: upload file into oracle throug www

From: Vladimir M. Zakharychev <bob_at_dpsp-yes.com>
Date: Wed, 24 Jul 2002 12:22:02 +0400
Message-ID: <ahlo3e$8f2$1@babylon.agtel.net>


Read the docs on file upload/download (section 1.7) - they are available by clicking on Help icon in the upper-right corner of DAD configuration screens in Administrative Gateway. Document table should have layout and column names documented there (at least, you can add your own columns at will). Here's an excerpt for fast reference:

<quote>
You can specify the document storage table on a per DAD basis. The document storage table must have the following definition:

CREATE TABLE [table_name] (

NAME           VARCHAR2(256) UNIQUE NOT NULL,
MIME_TYPE      VARCHAR2(128),
DOC_SIZE       NUMBER,

DAD_CHARSET VARCHAR2(128),
LAST_UPDATED DATE,
CONTENT_TYPE VARCHAR2(128),
[content_column_name] [content_column_type] [ , [content_column_name] [content_column_type]]

);

Users can choose the table_name. The content_column_type type must be either LONG RAW or BLOB.

The content_column_name depends on the corresponding content_column_type:

    a.. If the content_column_type is LONG RAW, the content_column_name must be CONTENT.

    b.. If the content_column_type is BLOB, the content_column_name must be BLOB_CONTENT. </quote>

--
Vladimir Zakharychev (bob@dpsp-yes.com)                http://www.dpsp-yes.com
Dynamic PSP(tm) - the first true RAD toolkit for Oracle-based internet applications.
All opinions are mine and do not necessarily go in line with those of my employer.


"Darek" <dooverone_at_pf.pl> wrote in message news:c553319b.0207232330.34a4a4ce_at_posting.google.com...

> Hello
> I know how to insert large objects in database (blob) with pl/sql , I also
> know how to display them on www, but I'd like to give the opportunity to my
> friends to upload some files and I don't know how to do it. I don't know how
> to transfer the content of file to the procedure.
> I read some former posts on group, and I know that the oracle uploads file
> automatically to document_table, name which can be changed by site (DAD
> configuration), I saw some procedures,
> none of them works. The problem is I don't know the format of document_table !!!
> In some documentation I even saw that the you cannot change document_table, ie
> OAS 4.XX uses document_content table or something like that ???
>
> my document_table is mytable
> Let's have a look at my example;
> 1.form procedure
> procedure uploadForm is
> begin
> htp.formOpen( '/pls/simpledad/webimg.printthis', 'POST', '
> ENCTYPE="multipart/form-data"');
> htp.formHidden( 'MAX_FILE_SIZE', '100000');
> htp.print( 'Send this file: ' );
> htp.print('<INPUT NAME="files" TYPE="file">')
> htp.formSubmit( NULL, 'Send File');
> htp.formClose;
> end;
>
> 2. upload procedure
>
> procedure printthis( files varchar2, MAX_FILE_SIZE varchar2 ) is
> begin
> htp.print( files || MAX_FILE_SIZE);
> end;
>
> this procedure is only to show that something happened, oracle does the
> upload automatically (probably)
>
> 3. my configuration wdbsvr.app
>
> [DAD_simpledad]
> connect_string = reposdb
> password = web
> username = web
> default_page = sample.home
> document_table = web.myTable
> document_path = docs
> document_proc =
> upload_as_long_raw =
> upload_as_blob = yes
> name_prefix =
> always_describe =
> after_proc =
> before_proc =
> reuse = Yes
> ;connmax =
> pathalias =
> pathaliasproc =
> enablesso = No
> sncookiename =
> stateful = No
> ;custom_auth =
> >
> 4. SQL> desc mytable;
> Name Null? Type
> ------------------------------- -------- ----
> WHO VARCHAR2(100)
> DESCRIPTION VARCHAR2(255)
> FILES BLOB
> MAX_FILE_SIZE VARCHAR2(1024)
>
> mytable is default document table
>
> 5. oracle 8.17 + web pl/sql generator installed
> 6. I don't see any error and there's nothing in my mytable;
> 7. Where does my server know from which column to use
>
> I'd be grateful for any help
>
> Darek
Received on Wed Jul 24 2002 - 03:22:02 CDT

Original text of this message

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