CODE
Oracle Code Library
JOBS
Find Or Post Oracle Jobs
FORUM
Oracle Discussion & Chat
PSOUG Home Code Snippets Oracle Reference Oracle Functions PSOUG Forum Oracle Blogs Bookmark and Share
 
 Search the Reference Library pages:  

Free
Oracle Magazine
Subscriptions
and Oracle White Papers

Oracle WPG_DOCLOAD
Version 11.1
 
General Information
Source {ORACLE_HOME}/rdbms/admin/wpgdocs.sql
Constants
Name Data Type Value
max_doctable_name_len PLS_INTEGER 256
mimet_col_len PLS_INTEGER 48
name_col_len PLS_INTEGER 64
Defined Data Types TYPE parts_table IS TABLE OF VARCHAR2(256) INDEX BY BINARY_INTEGER;
Dependencies
DBMS_LOB WWV_FLOW_FLASH_CHART
DBMS_SQL WWV_FLOW_IMAGE_GENERATOR
DBMS_SYS_SQL WWV_FLOW_LOAD_DATA
HTP WWV_FLOW_PAGE_CACHE_API
OWA_UTIL WWV_FLOW_RENDER_QUERY
WK_QUTIL WWV_FLOW_SVG
WWV_FLOW_DATALOAD_XML WWV_FLOW_XLIFF
WWV_FLOW_FILE_MGR WWV_RENDER_REPORT3
Security Model Owned by SYS no privileges are granted on this package
 
DOWNLOAD_FILE
Signals the PL/SQL Gateway that p_blob is to be downloaded to the client's browser

Overload 1
wpg_docload.download_file(
p_filename IN VARCHAR2, 
p_bcaching IN BOOLEAN DEFAULT TRUE);
TBD
Overload 2 wpg_docload.download_file(p_blob IN OUT NOCOPY BLOB);
TBD
Overload 3 wpg_docload.download_file(p_blob IN OUT BFILE);
TBD
 
GET_CONTENT_LENGTH
Return the length of a lob to be downloaded wpg_docload.get_content_length RETURN PLS_INTEGER;
TBD
 
GET_DOWNLOAD_BFILE (private ... do not use)
Get the bfile to be downloaded wpg_docload.get_download_blob(p_bfile OUT BFILE);
TBD
 
GET_DOWNLOAD_BLOB (private ... do not use)
Get the blob to be downloaded wpg_docload.get_download_blob(p_blob OUT NOCOPY BLOB);
TBD
 
GET_DOWNLOAD_FILE (private ... do not use)
Get the name and mime_type of the file to be downloaded wpg_docload.get_download_file(p_doc_info OUT VARCHAR2);
TBD
IS_FILE_DOWNLOAD
Is there a file to download? wpg_docload.is_file_download RETURN BOOLEAN
TBD
Unvalidated: From Burleson's book

GRANT execute ON display_easy_image TO public;

CREATE OR REPLACE PROCEDURE display_easy_image( p_id NUMBER ) AS
 s_mime_type VARCHAR2(48);
 n_length NUMBER;
 s_filename VARCHAR2(400);
 lob_image BLOB;
BEGIN
  SELECT mime_type, dbms_lob.getlength( blob_content ), filename, blob_content
  INTO s_mime_type, n_length, s_filename, lob_image
  FROM easy_image
  WHERE image_id = p_id;

  -- Set the size so the browser knows how much it will be downloading.
  owa_util.mime_header(NVL( s_mime_type, 'application/octet' ), FALSE );
  htp.p( 'Content-length: ' || n_length );
  -- The filename will be used by the browser if the users does a "Save as"
  htp.p( 'Content-Disposition: filename="' || s_filename || '"' );
  owa_util.http_header_close;
  -- Download the BLOB
  wpg_docload.download_file( lob_image );
END display_easy_image;
/
 
Related Topics
DBMS_LOB
 
Home      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us [153 users online]    © 2010 psoug.org