You can use Oracle Portal forms to enable users to upload files to the database. For example, suppose you are creating an employee database that contains personal information about the employees, as well as their photographs. You can create a personal information entry form where users enter their names, addresses, and birthdates, as well as .gif or .jpeg images of themselves.
Unless you use interMedia, you will generally want to upload files in binary format. To upload files in binary format, make sure that the table where you want to store the uploaded files contains a BLOB column type. If you have interMedia installed and want to upload interMedia files, make sure that the table contains a column with the appropriate interMedia file type ORDIMAGE. The image must be prefixed with the schema that owns it, typically ORDSYS. For example, ordsys.myimage.
You can use either the Form based on table or view OR the Master-detail form wizards. You cannot enable users to upload files with a form based on a procedure.
The following steps help you add a field to a new or existing form that will update a table containing either a column of BLOB type or of interMedia type.
To add a field to a form that enables users to upload files (BLOB type):
Create or edit a form. The form you create or edit must be a master-detail form or based on a table or view.
On the Formatting and Validation tab, in the left column, click the name of the column to which you want to upload files.
In the Item Type list, choose File Upload (Binary).
Under Validation Options, specify whether you want users to be able to upload files to the database.
Note: Select the Updateable check box if you want users to be able to upload files to the database. If you want to prevent others from uploading files to the database, make sure this check box is deselected; when the form displays, users will not see the field.
Choose a column (datatype must be VARCHAR2, VARCHAR, or CHAR) that will contain the MIME information OR enter a fixed MIME type. The column must be large enough to hold the largest mime type.
Note: Whenever a user uploads a file, the database must store the MIME type. You can either choose a column from the drop-down list that will store the MIME type for each file that is uploaded, or you can enter a fixed MIME type. Entering a fixed MIME type will force every file that is uploaded to use the specified MIME type.
Make any other modifications to the field.
Finish creating the form, then click Finish. When the user uploads a file using the form, the image displays.
To add a field to a form that enables users to upload files (interMedia type):
Create or edit a form. The form you create or edit must be a master-detail form or based on a table or view.
On the Formatting and Validation tab, in the left column, click the name of the column to which you want to upload files.
In the Item Type list, choose File Upload (interMedia).
Under Validation Options, specify whether you want users to be able to upload files to the database. interMedia hands the mime type for you.
Note: Select the Updateable check box if you want users to be able to upload files to the database. If you want to prevent others from uploading files to the database, make sure this check box is deselected; when the form displays, users will not see the field.
Make any other modifications to the field.
Finish creating the form, then click Finish. When the user uploads a file using the form, the image displays.
Notes
If you are uploading to a BLOB column, you must either choose a VARCHAR column where the MIME type for the file will be stored or enter a specific, fixed MIME type.
If you are not sure how to add a column to the table, see your database administrator. She can either use the Create Table wizard to add a BLOB column, or use SQL to add an interMedia column.
In a master-detail form, you can use BLOB and/or interMedia column types in either or both the master form and detail form.
For more information about BLOBs and interMedia, see your Oracle8i Documentation.
A browser plug-in such as QuickTime may be required to properly display some interMedia content.