How do you read and print a BLOB field when doing a file upload [message #200624] |
Tue, 31 October 2006 09:22  |
Duane
Messages: 581 Registered: December 2002
|
Senior Member |
|
|
Ok, I'm working on getting a web page working that allows a user to upload a file from their desktop to an Oracle server.
The page is just like the one here with "File Attachments" and the "Upload File" button.
I've setup the document table used by the DAD and the uploaded file is put into the BLOB content column. Now, how do I get the file out of the BLOB column so that I can insert the data into a table?
The uploaded file is a comma-delimited file that I need to insert into another table. This is what I don't know how to do.
CREATE TABLE DOCUMENTTABLE
(
NAME VARCHAR2(128 BYTE) NOT NULL,
MIME_TYPE VARCHAR2(128 BYTE),
DOC_SIZE NUMBER,
DAD_CHARSET VARCHAR2(128 BYTE),
LAST_UPDATED DATE,
CONTENT_TYPE VARCHAR2(128 BYTE),
CONTENT LONG RAW,
BLOB_CONTENT BLOB
)
|
|
|
|
|
Re: How do you read and print a BLOB field when doing a file upload [message #200652 is a reply to message #200643] |
Tue, 31 October 2006 13:53  |
Duane
Messages: 581 Registered: December 2002
|
Senior Member |
|
|
I don't think that will work since the file that is contained/uploaded in the blob_content is comma-delimited.
The uploaded data/file that is in the blob_content of the documenttable looks like this:
"29431", "38967"
"28631", "23478"
"30789", "38543"
"31290", "45610"
"35760", "25741"
It's a comma-delimited file that will need to be inserted into another table.
CREATE TABLE high_school
(
reference_number VARCHAR2 (5 BYTE),
hs_ceeb_code VARCHAR2 (5 BYTE)
)
They upload the file using a web page and then that data/file is used to populate the high_school table. I got the DAD to do the upload but I couldn't figure out how to get the data/file back out of the documenttable.
|
|
|