<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12">
<TITLE>R: [opencms-dev] Use of commons-fileupload with OpenCMS</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2>Hi Alexander,</FONT>
</P>
<P><FONT SIZE=2>I've tried your code but when I post a multipart-form data to a JSP page I get anout of memory error.</FONT>
<BR><FONT SIZE=2>I've tried this under tomact and it works.</FONT>
</P>
<P><FONT SIZE=2>Can you help me ?</FONT>
</P>
<BR>
<BR>
<P><FONT SIZE=2>-----Messaggio originale-----</FONT>
<BR><FONT SIZE=2>Da: Alexander Kandzior [<A HREF="mailto:alex@opencms.org">mailto:alex@opencms.org</A>] </FONT>
<BR><FONT SIZE=2>Inviato: venerd́ 6 febbraio 2004 12.11</FONT>
<BR><FONT SIZE=2>A: opencms-dev@opencms.org</FONT>
<BR><FONT SIZE=2>Oggetto: RE: [opencms-dev] Use of commons-fileupload with OpenCMS</FONT>
</P>
<BR>
<P><FONT SIZE=2>In fact OpenCms 5 automatically resolves the MIME Multipart for you so you don't need to care about this in your OpenCms application. </FONT></P>
<P><FONT SIZE=2>You must use something like this to access the contents of binary</FONT>
<BR><FONT SIZE=2>attachements:</FONT>
</P>
<P><FONT SIZE=2>CmsObject cms;</FONT>
<BR><FONT SIZE=2>...</FONT>
<BR><FONT SIZE=2>Enumeration e = cms.getRequestContext().getRequest().getFileNames();</FONT>
<BR><FONT SIZE=2>while (e.hasMoreElements()) {</FONT>
<BR><FONT SIZE=2> String name = (String)e.nextElement();</FONT>
<BR><FONT SIZE=2> byte[] content = cms.getRequestContext().getRequest().getFile(name);</FONT>
<BR><FONT SIZE=2> // do something with content</FONT>
<BR><FONT SIZE=2>}</FONT>
</P>
<P><FONT SIZE=2>Best Regards,</FONT>
<BR><FONT SIZE=2>Alex.</FONT>
</P>
<P><FONT SIZE=2>Alexander Kandzior</FONT>
<BR><FONT SIZE=2>Alkacon Software - The OpenCms Experts</FONT>
<BR><FONT SIZE=2><A HREF="http://www.alkacon.com" TARGET="_blank">http://www.alkacon.com</A></FONT>
</P>
<P><FONT SIZE=2>> -----Original Message-----</FONT>
<BR><FONT SIZE=2>> From: opencms-dev-admin@opencms.org</FONT>
<BR><FONT SIZE=2>> [<A HREF="mailto:opencms-dev-admin@opencms.org">mailto:opencms-dev-admin@opencms.org</A>] On Behalf Of Ben Rometsch</FONT>
<BR><FONT SIZE=2>> Sent: Friday, February 06, 2004 10:34 AM</FONT>
<BR><FONT SIZE=2>> To: opencms-dev@opencms.org</FONT>
<BR><FONT SIZE=2>> Subject: Re: [opencms-dev] Use of commons-fileupload with OpenCMS</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> Sorry to bump a topic, but has anyone successfully used OpenCMS to</FONT>
<BR><FONT SIZE=2>> upload files via a MIME Multipart http post? Not necessarily using </FONT>
<BR><FONT SIZE=2>> fileupload?</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> Thanks,</FONT>
<BR><FONT SIZE=2>> Ben</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> Ben Rometsch wrote:</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> > Hi There,</FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> > I cannot get the jakarta-commons file-upload API to work under</FONT>
<BR><FONT SIZE=2>> > openCMS.</FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> > <A HREF="http://jakarta.apache.org/commons/fileupload/" TARGET="_blank">http://jakarta.apache.org/commons/fileupload/</A></FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> > According to fileupload, the multi-part form request that</FONT>
<BR><FONT SIZE=2>> is generated</FONT>
<BR><FONT SIZE=2>> > by the browser when trying to upload a file contains NO name-value</FONT>
<BR><FONT SIZE=2>> > pairs. I have run identical code in a pure tomcat/jsp </FONT>
<BR><FONT SIZE=2>> environment and</FONT>
<BR><FONT SIZE=2>> > it works fine.</FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> > Has anyone successfully used file-upload with OpenCMS? Or is there </FONT>
<BR><FONT SIZE=2>> > another standard way of handling multipart forms?</FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> > Thanks,</FONT>
<BR><FONT SIZE=2>> > Ben</FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> --</FONT>
<BR><FONT SIZE=2>> ----== Solid State Group ==----</FONT>
<BR><FONT SIZE=2>> Web www.solidstategroup.com</FONT>
<BR><FONT SIZE=2>> Email ben@solidstategroup.com</FONT>
<BR><FONT SIZE=2>> MSN benrometsch@hotmail.com</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> _______________________________________________</FONT>
<BR><FONT SIZE=2>> This mail is send to you from the opencms-dev mailing list</FONT>
<BR><FONT SIZE=2>> To change your list options, or to unsubscribe from the list,</FONT>
<BR><FONT SIZE=2>> please visit <A HREF="http://mail.opencms.org/mailman/listinfo/opencms-dev" TARGET="_blank">http://mail.opencms.org/mailman/listinfo/opencms-dev</A></FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> </FONT>
</P>
<P><FONT SIZE=2>_______________________________________________</FONT>
<BR><FONT SIZE=2>This mail is send to you from the opencms-dev mailing list</FONT>
<BR><FONT SIZE=2>To change your list options, or to unsubscribe from the list, please visit <A HREF="http://mail.opencms.org/mailman/listinfo/opencms-dev" TARGET="_blank">http://mail.opencms.org/mailman/listinfo/opencms-dev</A></FONT></P>
</BODY>
</HTML>