Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Upload two files to Oracle through web form
Hi Robert -
I have done this - you'll need to check out the code I've outlined below to see how it can work. You need to do something like this:
snip ------------------------------------------------
htp.tablerowopen;
htp.tabledata(htf.bold('JAR File: '), 'right');
htp.tabledata('<INPUT type="file" name="p_mtm_jar">');
htp.tablerowclose;
htp.tablerowopen;
htp.tabledata(htf.bold('GIF File: '), 'right');
htp.tabledata('<INPUT type="file" name="p_mtm_gif">');
htp.tablerowclose;
htp.tablerowopen;
htp.tabledata(htf.bold('OMD name: '), 'right',
cattributes=>'valign="bottom"');
htp.print('<td align="left" valign="bottom">');
htp.formselectopen('p_mtm_omd');
for r in (select id, name, omdfilename from omd) loop
htp.formselectoption(r.name||' : '||r.omdfilename,
cattributes=>'VALUE="'||r.id||'"');
end loop;
htp.formselectclose;
htp.print('</td>');
htp.tablerowclose;
htp.tablerowopen;
htp.tabledata(htf.bold('Project: '), 'right');
htp.print('<td>');
htp.formselectopen('p_prj_name');
htp.formselectoption(' ');
for r in (select name from projects) loop
if r.name = 'TEMP' then htp.formselectoption(r.name, 'SELECTED'); else htp.formselectoption(r.name); end if;
htp.tableclose;
htp.para;
htp.formclose;
-------------------------------------- end snip ------------------------------------------
Of course, you'll also have to write the procedure that handles the processing of this:
snip ----------------------------------------------- -- ************************* write_mtm *******************************procedure write_mtm (
p_mtm_mspec in varchar2, p_mtm_jar in varchar2, p_mtm_gif in varchar2 default 'swirlsm', p_mtm_omd in varchar2, p_prj_name in varchar2 default 'TEMP'
v_gif mtm.fidelityrate%type;
begin
delete from mtm where jarname = substr(p_mtm_jar, instr(p_mtm_jar, '/')+1);
exception
when others then
htp.print('Error in package doc_pkg.write_mtm: ' || sqlerrm);
end write_mtm;
----------------------------------------- end snip ------------------------------------------------
Also, please study the examples in the modplsql DAD definition documentation to see how to populate the doc_table. If you need help, I can also send that too.
Good luck -
Carla
"Robert Johnson" <wibble999_at_nospamhotmail.com> wrote in message news:0E16861EE7BCD111BE9400805FE6841F1C62731D_at_C1S5X001...
> I currently have a supplier making some web pages for my company web site > and have been informed of some functionality which I would like, but have > been told is not possible (but I just want to check!). They are made with > plain Oracle database webpage generation. > > On one page there is a form requesting a users details and I need the user > to be able to upload 2 seperate documents (into two fields in an OracleDB).
> submission of the form. My question is.... is this correct or is there a > possible workaround? Ideally there should be a form with two 'Browse' > buttons on, to allow the user to attach two documents. > > Thanks for any help/ideas/advice. > > Regards > > > > >Received on Mon Jun 24 2002 - 19:06:18 CDT
![]() |
![]() |