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

Alexander Kandzior alex at opencms.org
Fri Feb 6 12:12:02 CET 2004


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
> 
> 




More information about the opencms-dev mailing list