Name | Code | Description |
---|---|---|
gc_content_disposition_inline | gc_content_disposition_inline constant varchar2(20) := 'inline'; |
For downloading file and viewing inline |
gc_content_disposition_attach | gc_content_disposition_attach constant varchar2(20) := 'attachment'; |
For downloading file as attachment |
Returns the mime-type for a filename
function get_mime_type(
p_filename in varchar2)
return oos_util_values.value%type
Name | Description |
---|---|
p_filename |
Filename |
return | mime-type |
select
oos_util_web.get_mime_type('file.xls') xls,
oos_util_web.get_mime_type('file.txt') txt,
oos_util_web.get_mime_type('file.swf') swf
from dual;
XLS TXT SWF
-------------------------- ------------ ------------------------------
application/vnd.ms-excel text/plain application/x-shockwave-flash
Download file
Will call apex_application.stop_apex_engine
if called from within an APEX application
procedure download_file(
p_filename in varchar2,
p_mime_type in varchar2 default null,
p_content_disposition in varchar2 default oos_util_web.gc_content_disposition_attach,
p_cache_control in varchar2 default null,
p_blob in blob
)
Name | Description |
---|---|
p_filename |
Filename |
p_mime_type |
mime-type of file. If null will be automatically resolved via p_filename |
p_content_disposition |
inline or attachment |
p_cache_control |
options to pass to the Cache-Control attribute. Examples include max-age=3600, no-cache, etc. See https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/http-caching?hl=en for examples |
p_blob |
File to be downloaded |
oos_util_web.download_file(
p_filename => 'my_file.zip',
p_blob => l_file):
Download clob file
Notes:
- See download_file (blob) for full documentation
procedure download_file(
p_filename in varchar2,
p_mime_type in varchar2 default null,
p_content_disposition in varchar2 default oos_util_web.gc_content_disposition_attach,
p_cache_control in varchar2 default null,
p_clob in clob)
Name | Description |
---|---|
p_filename |
|
p_mime_type |
|
p_content_disposition |
|
p_cache_control |
See download_file (blob) for documentation |
p_clob |
oos_util_web.download_file(
p_filename => 'my_file.txt',
p_clob => l_file):