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

Ben Rometsch ben at solidstategroup.com
Fri Feb 6 13:41:01 CET 2004


Erm, I'm not quite sure what you mean...

Doing something like this:

    message += "\nEmail: " + cms.getRequestContext().getParameter("email");

or this:

    message += "\nEmail: " + 
cms.getRequestContext().getRequest().getParameter("email");

fails. Can you provide me with a liner on how to get a standard request 
parameter from the HTTPRequest?

Thanks

Alexander Kandzior wrote:

>Yes, in an I_Cmsrequest. Use the code from my previous mail to access this. 
>
>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 1:29 PM
>>To: opencms-dev at opencms.org
>>Subject: Re: [opencms-dev] Use of commons-fileupload with OpenCMS
>>
>>
>>Right. ALMOST THERE!
>>
>>I cant seem to access the standard form fields now - either with the 
>>request.getAttribute or request.getParameter methods - am I missing 
>>something? Does openCMS wrap these in something else?
>>
>>Thanks,
>>Ben
>>
>>Alexander Kandzior wrote:
>>
>>    
>>
>>>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
>>>
>>>
>>> 
>>>
>>>      
>>>
>>-- 
>>----== 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
>
>
>  
>

-- 
----== Solid State Group ==----
Web     www.solidstategroup.com
Email   ben at solidstategroup.com
MSN     benrometsch at hotmail.com




More information about the opencms-dev mailing list