|File upload + PL/SQL Server Pages [message #169586]
||Thu, 27 April 2006 12:09
Registered: April 2006
Location: Rzeszow, Poland
I have a problem with uploading files into database from PL/SQL Server Page. I know, there is a chapter in 'mod_plsql User's Guide' about it, but I don't understand few things.
First - the documents storage table. In 'User's Guide' it is written, that this table MUST have the following definition (BLOB type is chosen for content column):
CREATE TABLE MYDOCTABLE (
NAME VARCHAR(256) UNIQUE NOT NULL,
CONTENT LONG RAW,
BLOB_CONTENT BLOB ;
Alright. I created this table and added line in DAD file about it (PlsqlDocumentTablename parameter).
Next, I tried to run the example of uploading files which is in mentioned 'mod_plsql User's Guide'.
Form (part of PSP Page):
<FORM enctype="multipart/form-data "action="pls/mydad/write_info "method="POST">
<p>Author's Name:<INPUT type="text" name="who">
<p>Description:<INPUT type="text" name="description">
<p>File to upload:<INPUT type="file" name="file">
procedure write_info (
who in varchar2,
description in varchar2,
file in varchar2) as
insert into myTable values (who, description, file);
htp.header(1, 'Upload Status');
htp.print('Uploaded ' || file || ' successfully');
As you can see, documents storage table and table in this procedure are completely different. So I don't understand how should it works. If anyone have an idea how to solve my problem... I will be thankfull. Especially I'd like to know:
1. correct storage table definition (does it really must be identical as the one I've written. I want to keep some additional information about uploaded files, so...)
2. procedure handling upload.
P.S. Sorry for my English. I hope you understand what I wanted to say:)