File upload & download?

Oracle Application Express is a rapid development tool for Web applications on the Oracle database.
Post Reply
admin
Posts: 2062
Joined: Fri Mar 31, 2006 12:59 am
Location: Pakistan
Contact:

File upload & download?

Post by admin »

Recommended column details

FILENAME: ICON_NAME in the example below. Tracks the actual filename so that downloads of the file are given an appropriate name. Without this attribute a download link would not know what filename to download a file as.
BLOB: ICON_BLOB in the example below. The Binary Large Object (BLOB) database column used to store uploaded files into database tables. The Oracle BLOB datatype is virtually unlimited in size.
MIMETYPE: ICON_MIMETYPE in the example below. The mimetype is used by the bowser to identify which application should be used to display the content of a downloaded BLOB data. The BLOB datatype does not maintain this information so it is important to manage this data in its own column.
CHARACTER SET: ICON_CHARSET in the example below. Identifies the character set used to download the file. The character set of a BLOB column is not automatically tracked so it will need to be maintained in a separate column.
LAST_UPDATED: ICON_LAST_UPDATED in the example below. Tracks the timestamp of when the file was last updated and can be used for browser caching. It is not required but can dramatically improve performance of some applications.

CREATE TABLE EBA_DEMO_FILE_PROJECTS
(
ID NUMBER,
row_version_number NUMBER,
project VARCHAR2(30) not null,
task_name VARCHAR2(255) not null,
start_date DATE not null,
end_date DATE not null,
status VARCHAR2(30) not null,
assigned_to VARCHAR2(30),
cost NUMBER,
budget NUMBER,
created_on TIMESTAMP WITH LOCAL TIME ZONE,
created_by VARCHAR2(255),
browser_env VARCHAR2(4000),
icon_name VARCHAR2(4000),
icon_blob BLOB,
icon_mimetype VARCHAR2(512),
icon_charset VARCHAR2(512),
icon_last_updated TIMESTAMP WITH LOCAL TIME ZONE,
icon_comments VARCHAR2(4000),
CONSTRAINT EBA_DEMO_FILE_PROJECTS_PK PRIMARY KEY (ID) ENABLE
) ;

select
ID,
ROW_VERSION_NUMBER,
PROJECT_ID,
FILENAME,
FILE_MIMETYPE,
FILE_CHARSET,
FILE_BLOB,
FILE_COMMENTS,
TAGS,
CREATED,
CREATED_BY,
UPDATED,
UPDATED_BY,
sys.dbms_lob.getlength(file_blob) file_size,
sys.dbms_lob.getlength(file_blob) download
from EBA_DEMO_FILES

source oracle examples
Malik Sikandar Hayat
admin@erpstuff.com
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests