Home » Developer & Programmer » Application Express, ORDS & MOD_PLSQL » File upload + PL/SQL Server Pages
File upload + PL/SQL Server Pages [message #169586] Thu, 27 April 2006 12:09 Go to next message
bartekt
Messages: 1
Registered: April 2006
Location: Rzeszow, Poland
Junior Member
Hi,

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,
MIME_TYPE VARCHAR(128),
DOC_SIZE NUMBER,
DAD_CHARSET VARCHAR(128),
LAST_UPDATED DATE,
CONTENT_TYPE VARCHAR(128),
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">

<p><INPUT type="submit">

uploading procedure:
procedure write_info (
who in varchar2,
description in varchar2,
file in varchar2) as
begin
insert into myTable values (who, description, file);
htp.htmlopen;
htp.headopen;
htp.title('File Uploaded');
htp.headclose;
htp.bodyopen;
htp.header(1, 'Upload Status');
htp.print('Uploaded ' || file || ' successfully');
htp.bodyclose;
htp.htmlclose;
end;

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.

Regards

P.S. Sorry for my English. I hope you understand what I wanted to say:)
Re: File upload + PL/SQL Server Pages [message #169612 is a reply to message #169586] Thu, 27 April 2006 14:26 Go to previous message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
The table structure has changed over time. Make sure the version of the OWA, WPG_DOCLOAD packages is the same as the version docs you are refering to. Not sure where you check the OWA version info is referenced.
Previous Topic: Create downloadable RTF
Next Topic: Problem with translation
Goto Forum:
  


Current Time: Thu Mar 28 19:19:07 CDT 2024