Home » Developer & Programmer » Application Express, ORDS & MOD_PLSQL » Creating File Uploader
Creating File Uploader [message #178063] Mon, 19 June 2006 05:18 Go to next message
asurana
Messages: 5
Registered: June 2006
Junior Member

I want to create a page to upload a spreadsheet and then want it to save into a predefined table.

Can anyone suggest me any way?

[Updated on: Mon, 19 June 2006 05:19]

Report message to a moderator

Re: Creating File Uploader [message #178090 is a reply to message #178063] Mon, 19 June 2006 06:31 Go to previous messageGo to next message
Frank Naude
Messages: 4579
Registered: April 1998
Senior Member
Create a new application and select option "Create from Spreadsheet".

"From a Spreadsheet:
Create an application based on spreadsheet data. Upload or paste spreadsheet data to create a table. The application will feature query, insert, update, and analysis capabilities on the newly created table."
Re: Creating File Uploader [message #178092 is a reply to message #178063] Mon, 19 June 2006 06:36 Go to previous messageGo to next message
asurana
Messages: 5
Registered: June 2006
Junior Member

Thanks for your reply.

Sorry, I didn't clearly mention my question.
Actually, i want to put this functionality into an existing application and even on a existing page also.

Thanks
Re: Creating File Uploader [message #178095 is a reply to message #178063] Mon, 19 June 2006 06:42 Go to previous messageGo to next message
asurana
Messages: 5
Registered: June 2006
Junior Member

I got it.
Thanks

-Whould u like to be a part of my buddy list?
send me a message to amit.surana@yahoo.com / YID - amit.surana
Re: Creating File Uploader [message #178140 is a reply to message #178095] Mon, 19 June 2006 09:59 Go to previous messageGo to next message
Frank Naude
Messages: 4579
Registered: April 1998
Senior Member
So, how did you solve the problem?
Re: Creating File Uploader [message #178177 is a reply to message #178140] Mon, 19 June 2006 23:44 Go to previous message
asurana
Messages: 5
Registered: June 2006
Junior Member

For that you first create a column of BLOB type in table and store the file content in that column and then to display that you have to write the below procedure -
[Change accordingly]

CREATE OR REPLACE PROCEDURE download_my_file(p_file in number) AS
v_mime VARCHAR2(48);
v_length NUMBER;
v_file_name VARCHAR2(2000);
Lob_loc BLOB;
BEGIN
SELECT MIME_TYPE, BLOB_CONTENT, name,DBMS_LOB.GETLENGTH(blob_content)
INTO v_mime,lob_loc,v_file_name,v_length
FROM file_subjects
WHERE id = p_file;
--
-- set up HTTP header
--
-- use an NVL around the mime type and
-- if it is a null set it to application/octect
-- application/octect may launch a download window from windows
owa_util.mime_header( nvl(v_mime,'application/octet'), FALSE );

-- set the size so the browser knows how much to download
htp.p('Content-length: ' || v_length);
-- the filename will be used by the browser if the users does a save as
htp.p('Content-Disposition: attachment; filename="'||substr(v_file_name,instr(v_file_name,'/')+1)|| '"');
-- close the headers
owa_util.http_header_close;
-- download the BLOB
wpg_docload.download_file( Lob_loc );
end download_my_file;
/
Previous Topic: HTMDB Installation
Next Topic: viewing multiple images in AppEx
Goto Forum:
  


Current Time: Fri Mar 29 03:31:57 CDT 2024