R: [opencms-dev] Use of commons-fileupload with OpenCMS

Campione Aldo aldo.campione at siemens.com
Thu Mar 18 09:57:01 CET 2004


Hi Alexander,

I've tried your code but when I post a multipart-form data to a JSP page I
get anout of memory error.
I've tried this under tomact and it works.

Can you help me ?



-----Messaggio originale-----
Da: Alexander Kandzior [mailto:alex at opencms.org] 
Inviato: venerdì 6 febbraio 2004 12.11
A: opencms-dev at opencms.org
Oggetto: RE: [opencms-dev] Use of commons-fileupload with OpenCMS


In fact OpenCms 5 automatically resolves the MIME Multipart for you so you
don't need to care about this in your OpenCms application. 

You must use something like this to access the contents of binary
attachements:

CmsObject cms;
...
Enumeration e = cms.getRequestContext().getRequest().getFileNames();
while (e.hasMoreElements()) {
   String name = (String)e.nextElement();
   byte[] content = cms.getRequestContext().getRequest().getFile(name);
   // do something with content
}

Best Regards,
Alex.

Alexander Kandzior
Alkacon Software - The OpenCms Experts
http://www.alkacon.com

> -----Original Message-----
> From: opencms-dev-admin at opencms.org
> [mailto:opencms-dev-admin at opencms.org] On Behalf Of Ben Rometsch
> Sent: Friday, February 06, 2004 10:34 AM
> To: opencms-dev at opencms.org
> Subject: Re: [opencms-dev] Use of commons-fileupload with OpenCMS
> 
> 
> Sorry to bump a topic, but has anyone successfully used OpenCMS to
> upload files via a MIME Multipart http post? Not necessarily using 
> fileupload?
> 
> Thanks,
> Ben
> 
> Ben Rometsch wrote:
> 
> > Hi There,
> >
> > I cannot get the jakarta-commons file-upload API to work under
> > openCMS.
> >
> > http://jakarta.apache.org/commons/fileupload/
> >
> > According to fileupload, the multi-part form request that
> is generated
> > by the browser when trying to upload a file contains NO name-value
> > pairs. I have run identical code in a pure tomcat/jsp 
> environment and
> > it works fine.
> >
> > Has anyone successfully used file-upload with OpenCMS? Or is there 
> > another standard way of handling multipart forms?
> >
> > Thanks,
> > Ben
> >
> 
> --
> ----== Solid State Group ==----
> Web     www.solidstategroup.com
> Email   ben at solidstategroup.com
> MSN     benrometsch at hotmail.com
> 
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list,
> please visit http://mail.opencms.org/mailman/listinfo/opencms-dev
> 
> 

_______________________________________________
This mail is send to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
http://mail.opencms.org/mailman/listinfo/opencms-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20040318/be130c76/attachment.htm>


More information about the opencms-dev mailing list