Search Results construct_download_url2




Overview

FND_GFM is the Oracle E-Business Suite "Generic File Manager" package body, owned by the APPS schema and classified under the ETRM as an OTHER API. It provides a centralized, reusable file-handling framework used across the EBS technology stack to store, retrieve, and stream binary and character content held in the database, principally within the FND_LOBS family of tables. Rather than requiring each product to implement its own upload/download mechanics, FND_GFM abstracts file identity, transactional access control, MIME typing, and HTTP delivery behind a consistent PL/SQL API.

The package is version-aware. A package-level global (g_release_version) distinguishes an 11i environment from an R12 environment by inspecting the type of the FND_FNDFLUPL function (WWW for 11i, JSP for R12), with setter and getter methods controlling access. This allows the same code base to emit correct URLs and dispatch behavior regardless of the hosting release. File content is tracked through an internal associative table of file_handle records; because PL/SQL does not physically remove elements from such tables, closed handles are nullified and empty slots are reused on subsequent opens, and each handle carries a numeric file descriptor and an offset for positioned reads and writes. The construct_download_url2 function referenced in the search is a member of this URL-construction family, producing a download URL for a stored file using the current release's conventions.

Key Procedures and Functions

  • AUTHENTICATE — Validates a supplied access key (and optionally a specific file identifier) against the access-control records before permitting a file operation.
  • AUTHORIZE — Performs the companion authorization check, establishing whether the caller may act on the requested file.
  • CONSTRUCT_DOWNLOAD_URL / CONSTRUCT_DOWNLOAD_URL2 — Build the URL through which a stored file may be downloaded; the "2" variant reflects an alternate or release-specific construction path.
  • CONSTRUCT_UPLOAD_URL — Builds the URL used to present an upload form for a file.
  • CONSTRUCT_GET_URL / CONSTRUCT_RELATIVE_GET — Generate absolute and relative retrieval URLs respectively for embedded or page-relative links.
  • CONFIRM_UPLOAD / WAIT_FOR_UPLOAD — Coordinate the asynchronous upload handshake, confirming completion and waiting on upload events (via DBMS_ALERT).
  • DISPATCH — Routes an incoming HTTP request to the appropriate GF M handler for the requested operation.
  • FILE_CREATE, FILE_WRITE, FILE_WRITE_LINE, FILE_CLOSE — Manage the file lifecycle: open a new file handle, append binary or line-oriented character data, and close the handle.
  • GET_FILE_ID — Returns the internal numeric identifier assigned to a file handle.
  • PURGE, PURGE_SET, PURGE_EXPIRED — Housekeeping routines that remove or expire obsolete file content, including targeted set purges and time-based cleanup of expired files.
  • DOWNLOAD — Streams stored content to the client, typically using HTP and OWA_UTIL.
  • TEST — A diagnostic entry point for validating package behavior.

Tables Accessed

FND_GFM reads and writes the FND_LOBS tables — FND_LOBS, FND_LOBS_S, FND_LOBS_DOCUMENT, and FND_LOBS_DOCUMENTPART — to persist and retrieve file content and its document parts. FND_LOB_ACCESS underpins the AUTHENTICATE and AUTHORIZE checks by mapping access identifiers to file identifiers. FND_MIME_TYPES supplies MIME typing for correct HTTP delivery, while FND_USER and FND_FORM_FUNCTIONS provide the user and function-security context. Locking and notification use DBMS_ALERT and PLITBLM; large-object manipulation uses DBMS_LOB and UTL_RAW; output uses HTP and OWA_UTIL. DUAL supports simple scalar queries.

Usage Notes

FND_GFM is invoked indirectly by EBS forms, OAF pages, and concurrent programs that need to attach, display, or download files, and it is referenced by fifteen other packages that depend on its services. Custom code should call the documented public functions — particularly the URL-construction and file-handling routines — rather than manipulating the underlying FND_LOBS tables directly, so that authentication, MIME handling, and release-specific URL logic remain consistent. Because the package sets standard FND_MESSAGE errors (via its internal err_msg shortcut, using the FND SQL_PLSQL_ERROR message), callers should check the returned status and message stack after operations such as upload confirmation or download dispatch.