Home » Developer & Programmer » Application Express, ORDS & MOD_PLSQL » file upload & download pl/sql server pages (oracle 9i)
file upload & download pl/sql server pages [message #640130] Wed, 22 July 2015 23:22 Go to next message
prempal
Messages: 4
Registered: July 2015
Location: INDIA
Junior Member
I want to upload pdf file in to oracle web server and downlaod the same pdf at client side (web server).

1. I am uploading the file but file is getting stored in binary code ,

2. I want to download the same file in same format as it was uploaded i.e., pdf/doc/excel.


i am trying to use this code

procedure---Write upload data .....


CREATE OR REPLACE procedure OCMSDEV.write_info (who in varchar2, description in varchar2,file in varchar2)
as
p number;
begin

select max(pid) into p from mytable;

p:=p+1;

insert into myTable(pid,WHO,DESCRIPTION,file1)
values (p,who,description,utl_raw.cast_to_raw('file'));
htp.htmlopen;
htp.headopen;
htp.title('File Uploaded');
htp.headclose;
htp.bodyopen;
htp.header(1, 'Upload Status');
htp.print('Uploaded ' || 'ID :'|| p || ' successfully');
htp.bodyclose;
htp.htmlclose;
end;
/


procedure for downloading images-----....

CREATE OR REPLACE PROCEDURE Display_Image(p_id NUMBER) IS
Photo BLOB;
a NUMBER:= 4096;
v_off NUMBER:= 1;
v_raw RAW(4096);
BEGIN

SELECT file1
INTO Photo
FROM mytable
WHERE pid = p_id;

owa_util.mime_header('images/gif');
BEGIN
LOOP
-- Read the BLOB
dbms_lob.READ(Photo, a, v_off, v_raw);
-- Display image
htp.prn(utl_raw.cast_to_varchar2(v_raw));
v_off := v_off + a;
a := 4096;
END LOOP;
dbms_lob.CLOSE(Photo);
EXCEPTION
WHEN NO_DATA_FOUND THEN
NULL;
END;

END;
/

kindly suggest me solution for uploading and downloading file into/from server pages PSP
Re: file upload & download pl/sql server pages [message #640131 is a reply to message #640130] Wed, 22 July 2015 23:28 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
> (oracle 9i)
above has been obsoleted & unsupported this whole Century. Please join 21st Century at you earliest convenience!

>I want to download the same file in same format as it was uploaded i.e., pdf/doc/excel.
Oracle knows NOTHING about any such arbitrary file extensions.

Please read and follow the forum guidelines, to enable us to help you:
OraFAQ Forum Guide
How to use [code] tags and make your code easier to read

Re: file upload & download pl/sql server pages [message #640133 is a reply to message #640131] Wed, 22 July 2015 23:46 Go to previous messageGo to next message
jgjeetu
Messages: 373
Registered: July 2013
Location: www.Orafaq.com/Forum
Senior Member

@BS is it possible to force a client to upgrade to higher version only because 9i is obsoleted & unsupported ?
Re: file upload & download pl/sql server pages [message #640136 is a reply to message #640133] Wed, 22 July 2015 23:54 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
jgjeetu wrote on Wed, 22 July 2015 21:46
@BS is it possible to force a client to upgrade to higher version only because 9i is obsoleted & unsupported ?



You can walk away & not facilitate bad choices.
Doing otherwise validate the bad choices.
Re: file upload & download pl/sql server pages [message #640219 is a reply to message #640136] Thu, 23 July 2015 23:17 Go to previous messageGo to next message
prempal
Messages: 4
Registered: July 2015
Location: INDIA
Junior Member
what is the process of oracle 10g form connecting to the web server ..
step to step explain ...

kindly suggest me solution for server pages PSP
Re: file upload & download pl/sql server pages [message #640250 is a reply to message #640219] Sat, 25 July 2015 06:37 Go to previous message
jgjeetu
Messages: 373
Registered: July 2013
Location: www.Orafaq.com/Forum
Senior Member

He don't know actually , you could wait for someone who knows how to solve it.
Previous Topic: copying a file to a server
Next Topic: How to implement a delay event
Goto Forum:
  


Current Time: Fri Mar 29 01:11:18 CDT 2024