Search Results get_download_file
Overview
SYS.WPG_DOCLOAD is a low-level PL/SQL utility package that underpins the file and document download mechanism in Oracle E-Business Suite. Its primary business function is to stage the content that a client browser requests — whether that content originates from a document table (stored as character data), a BLOB, or a BFILE — and then to serve that content to the requesting HTTP session through the Oracle HTTP Server / mod_plsql or Oracle Application Express (APEX) listener layer. In the EBS architecture, WPG_DOCLOAD acts as the bridge between application metadata that references an attachment or document and the actual binary or character payload that must be streamed to the end user.
The package name is often encountered when users search for "get_download_file," which is one of its documented procedures. It is owned by SYSTEM in the ETRM 12.2.2 metadata and classified as OTHER, reflecting that it is an Oracle-supplied framework package rather than an application-owner API.
Key Procedures and Functions
The ETRM metadata documents eight procedures and functions for this package. The most commonly referenced are:
- DOWNLOAD_FILE — Overloaded to set the content that will subsequently be downloaded. Variants accept a filename (character document), a BLOB, or a BFILE. The procedure merely stages the value into package globals; the actual streaming occurs later through the web listener. For document-table downloads a browser-caching flag is accepted, whereas BLOB and BFILE overloads omit caching because those are treated as self-service operations.
- GET_DOWNLOAD_FILE — Returns the currently staged filename (the v_filename global) for the active download. This is the routine users typically reach for when tracing which file is being served in a given request.
- GET_DOWNLOAD_BLOB — Returns the staged BLOB content set by the BLOB overload of DOWNLOAD_FILE.
- GET_DOWNLOAD_BFILE — Returns the staged BFILE locator set by the BFILE overload of DOWNLOAD_FILE.
- IS_FILE_DOWNLOAD — Boolean indicator of whether a file download is currently in progress for the session.
- GET_CONTENT_LENGTH — Returns the size of the staged content so the listener can emit an accurate Content-Length header.
The package also raises e_invalid_lobloc when a NULL BLOB is passed, guarding against invalid LOB locators.
Tables Accessed
The package does not directly manipulate EBS application tables. According to the documented metadata, it relies on the following PL/SQL-supplied packages rather than application tables:
- DBMS_LOB — Used to read and manipulate LOB and BFILE content being staged for download.
- DBMS_SQL and DBMS_SYS_SQL — Used for dynamic SQL, typically to resolve and read document-table content referenced by filename.
- OWA_UTIL — Provides HTTP-layer utilities for emitting headers and content to the browser.
The APPS synonyms for these packages are referenced so that the code executes in the EBS database context regardless of invoking schema.
Usage Notes
SYS.WPG_DOCLOAD is rarely invoked directly by end users. It is typically called from:
- Oracle Forms attachment and document buttons, which stage a filename or LOB and then hand control to the web listener.
- Concurrent programs and self-service web pages that stream BLOB or BFILE attachments.
- Custom PL/SQL code that implements a download endpoint, calling DOWNLOAD_FILE and then relying on the listener to invoke the GET_DOWNLOAD_* accessors.
- Diagnostic queries where a developer searches for "get_download_file" to identify the active download filename during a session.
Because state is held in package globals (v_filename, v_blob, v_bfile, v_bcaching), the staging and retrieval must occur within the same database session — a critical consideration when diagnosing download failures in EBS 12.1.1 or 12.2.2.
-
PACKAGE BODY: SYS.WPG_DOCLOAD
12.1.1
-
PACKAGE: SYS.WPG_DOCLOAD
12.1.1
-
PACKAGE: SYSTEM.WPG_DOCLOAD
12.1.1
-
PACKAGE BODY: SYS.WPG_DOCLOAD
12.2.2
-
PACKAGE: SYSTEM.WPG_DOCLOAD
12.2.2
-
PACKAGE: SYS.WPG_DOCLOAD
12.2.2
-
PACKAGE BODY: SYSTEM.WPG_DOCLOAD
12.2.2
-
PACKAGE BODY: SYSTEM.WPG_DOCLOAD
12.1.1
-
SYS.WPG_DOCLOAD dependencies on UTL_RAW
12.2.2
-
SYS.WPG_DOCLOAD dependencies on UTL_RAW
12.1.1
-
SYSTEM.WPG_DOCLOAD dependencies on DBMS_SYS_SQL
12.1.1
-
SYSTEM.WPG_DOCLOAD dependencies on DBMS_SYS_SQL
12.2.2
-
SYS.WPG_DOCLOAD dependencies on DBMS_SYS_SQL
12.2.2
-
SYS.WPG_DOCLOAD dependencies on DBMS_SYS_SQL
12.1.1