![]() L_filename := SUBSTR(OWA_UTIL.get_cgi_env('PATH_INFO'), 2) HTP.anchor('document_api.download?file=' || cur_rec.name, 'document_api.download?file=' || cur_rec.name) ![]() Create some links to demonstrate direct downloads. ![]() HTP.anchor('docs/' || cur_rec.name, 'docs/' || cur_rec.name) Create some links to demonstrate URL downloads.įOR cur_rec IN (SELECT name FROM documents) LOOP HTP.print('Upload of ' || l_real_name || ' failed.') HTP.print('Uploaded ' || l_real_name || ' successfully.') Update the prefixed name with the real file name. Delete any existing document to allow update. L_real_name := SUBSTR(file, INSTR(file, '/') + 1) Next we create a package specification which will contain all the necessary code.ĬREATE OR REPLACE PACKAGE document_api ASĬREATE OR REPLACE PACKAGE BODY document_api AS With this in place restart the HTTP server using the following commands.įor the upload to be successful the documents table must be created with the following structure. Make sure the PlsqlDatabaseConnectString parameter value has a corresponding entry in the "$ORACLE_HOME/network/admin/tnsnames.ora" file for the client ORACLE_HOME. Run the following command to obfuscate the DAD password. PlsqlDocumentProcedure document_api.download Add the following entry to the "$ORACLE_HOME/Apache/modplsql/conf/nf" file. In this article I'll demonstrate how it works with a simple example.įirst a Database Access Descriptor (DAD) must be created. ![]() Oracle provide a mechanism to upload and download files directly from the database using a Database Access Descriptor (DAD). ![]() ORACLE_HOME=/u01/app/oracle/product/10.1.0/client_1 export ORACLE_HOME The example assumes the the ORACLE_HOME environment variable has been set to this path also. This procedure to work the HTTP Server software, available on the Companion CD, must be installed into a separate ORACLE_HOME, typically, This article is an update of a previous Oracle9i article, which includes some modified configuration steps necessary in Oracle 10g. Home » Articles » 10g » Here File Upload and Download Procedures in Oracle Database 10g ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2023
Categories |