Uploading documents - table name configuration


Oracle's Web Toolkit (HTP/HTF) supports creating webpages with full control. I have been using them for my official project and we have built a framework associated with a style sheet we have created.

Among other things it supports uploading files by user. Using the HTML INPUT type="file" we can position the file selection dialog.

The form needs to be open with multipart/form-data.

For the first time if you are using this functionality you may have to configure the table name where Oracle populates the file in a BLOB column. The configuration is part of DAD, placed in Database server within /dbfolder/Apache/modplsql/conf/dads.conf file. "dbfolder" is where you have installed the database.

In the Location tag specify a table for the attribute
     PlsqlDocumentTablename MYDOCUMENTS

A sample document table can consist of the following:

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]]
);

Oracle then automatically uploads your document to this table.

Check mod_plsql User's Guide for more information on this. This is a mini-tip which I want to share for those who may be looking for the information.

No comments :

Post a Comment