Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
41
Добавлен:
16.04.2013
Размер:
4.96 Mб
Скачать

PL/SQL Gateway

Downloading Files From the Database

You can download a file from the database in several alternative ways:

Define a PL/SQL procedure that calls wpg_docload.download_ file(file_name) to download file file_name.

Define a virtual path for document downloads in the DAD configuration, and associate a user-defined procedure with that path. When PL/SQL Gateway detects the virtual path it automatically invokes the user-defined procedure, which in turn must call wpg_docload.download_file(file_name) to download file file_name.

Use the Direct BLOB Download mechanism to download a BLOB from any database table. You do this by calling a PL/SQL procedure that streams the standard HTTP headers, such as mime-type and content-length, and then invokes wpg_docload.download_file(blob_name) to download BLOB blob_name.

See Also: RFC 1867, "Form-Based File Upload in HTML" (IETF)

Custom Authentication With PL/SQL Gateway

To authenticate individual Web-browser users for database purposes, it would be cumbersome to provide a different Database Access Descriptor (DAD) and URL for each user. Typically, a single URL, corresponding to a single database user (schema), is used for all browser users.

This means that authentication of browser users is typically not performed by the database, but by the Web application. It is the application that determines if a given Web-browser user should have access to the database. It can also determine which database schema (hence which URL) to use for a given user. You use the OWA_ CUSTOM package of the PL/SQL Web Toolkit to perform such custom user authentication in Web applications.

For example, suppose you have a purchasing application that is accessed by multiple third-party vendors. Instead of creating a separate schema for each vendor, load the application into a common schema where all users log in. Using OWA_ CUSTOM, your application can authenticate each user, in any way it needs to. With OWA_CUSTOM, authentication is done only by the application, not by the database.

Custom authentication cannot be combined with dynamic username/password authentication; it needs to have a static username/password stored in the DAD configuration file. PL/SQL Gateway uses this DAD username/password to log in to the database.

Developing Web Applications with PL/SQL 13-5

Соседние файлы в папке Oracle 10g