The Oracle tutorial you are looking at is: Oracle three upload file technology.
There are several ways to upload files to a database or server file system in Oracle, and here are three of the following: Oracle HTTP server (OHS) Mod_plsql modules provide the ability to upload files to a database through a Web page; Oracle 9iAS Tag Library and the file upload function provided by the bean, upload files through the JDBC program.
The Oracle HTTP Server (OHS) Mod_plsql module provides the ability to upload files to a database through a Web page
1. To establish a document access table in the target mode of a file upload
Content_Type is listed as a blob or a long raw, but only one column in the table. Each uploaded file occupies a single row in the table and cannot upload multiple files to the same row in the table at the same time, which is where the Mod_plsql module has limited functionality. Use the following and columns to establish the document table: Content_table.
2. Configuring a Dad Document Access table
After you start the database and OHS, create a blank database access descriptor. On the Database Access Descriptor page, the gateway uses document table information to upload/download documents to the database associated with this database access descriptor. By default, all documents are uploaded with a BLOB. You can override this default setting by specifying a comma-delimited file name extension in the Long Raw field. The * value of this field will cause all documents to be uploaded with a Long Raw. The document Access procedure specifies the virtual path used to access the document. The Document Access procedure field specifies the procedure invoked by the gateway to process document requests. This specifies that the default document table is content_table.
3. Provides a file upload page that uses the form of stored procedures to upload and browse and download files.
4. Provide upload file browsing page
The file submitted in step 3rd is automatically uploaded to the document table, and the stored procedure Write_infos to record the uploaded file information is virtually unnecessary, but here's a comparison.
When you look at the document table, you'll find that the file has been uploaded, but the document table has been uploaded incorrectly, and it doesn't match the system time in the upload record, which may be a bug in the feature, and if anyone has a solution or a software patch to fix the problem, please let me know.
5. Provides page browsing for uploaded files
This allows you to browse through the file by using a Web browser based on the Mime_type type of the uploaded file.
The easiest way to upload files is to support Chinese file names, to support client file uploads and downloads, and to automatically recognize file types and calculate file sizes.
[NextPage]
Ii. Oracle 9iAS Tag Library and the file upload feature provided by the Bean
The Jdeveloper9031 in Oracle developer suit 9i provides a way to upload files through a tag library, in the following example in_file.jsp file provides an upload form, up_file.jsp lists the uploaded files, dn_ file.jsp file to download the file you just uploaded. This method uses the graphical editor, which is simple and feasible, but does not support the Chinese filename, and can upload and download the client file.
The following are the source programs for in_file.jsp:
up_file.jsp source program:
dn_file.jsp source program:
Third, file upload and download through JDBC
By uploading the file to a BLOB or CLOB column to implement the file upload, but this method does not support client file upload, so the limitation is very large, the download function through JDBC is also only in the server's local download (download program is not listed), so this method only as a technical reference can, not much practical value.
The blob_in_stream.jsp procedure is as follows:
The blob_w_stream.jsp procedure is as follows:
Previous page