[opencms-dev] multipart/form-data with other parameters

Urich, Chase ChaseUrich at letu.edu
Fri May 16 23:12:01 CEST 2003


Well, I guess I found it ... I figured I should post it here just on the
oddball chance that someone else may come looking for an answer too.

CmsRequestHttpServlet req =
(CmsRequestHttpServlet)cms.getCmsObject().getRequestContext().getRequest
();

If this isn't the recommended way to get an instance, please do tell.

Chase Urich
Web Programmer
LeTourneau University

-----Original Message-----
From: Urich, Chase 
Sent: Friday, May 16, 2003 2:36 PM
To: opencms-dev at opencms.org
Subject: RE: [opencms-dev] multipart/form-data with other parameters


After doing a bit more research, which I should have done first, I found
that OpenCMS tries to help me with this, but I am confused as to how to
use the OpenCMS functionality that is built in. I found the class
CmsRequestHttpServlet, but I have no idea how to obtain an instance of
it. If I try to create an instance, I'm told that there is no public
constructor, so how am I supposed to use this? It looks like it will do
absolutely everything I need right now ... If I can get it to work :)

Anyone willing to shed some light on this subject for me? I'm still very
new at Java as a whole.

Chase Urich
Web Programmer
LeTourneau University

-----Original Message-----
From: Marcus Redeker [mailto:mredeker at web.de] 
Sent: Friday, May 16, 2003 2:11 PM
To: opencms-dev at opencms.org
Subject: RE: [opencms-dev] multipart/form-data with other parameters


Chase,

I assume this is a normal behavior for file uploads using multipart and
not OpenCMS specific. There are a lot of servlet/jsp libraries available
which provide a wrapper to access the binary data and the regular
parameter. We always use the one from O'reilly:
http://www.servlets.com/cos/index.html

--Marcus


> -----Original Message-----
> From: opencms-dev-admin at opencms.org 
> [mailto:opencms-dev-admin at opencms.org] On Behalf Of Urich, Chase
> Sent: Friday, May 16, 2003 6:51 PM
> To: opencms-dev at opencms.org
> Subject: [opencms-dev] multipart/form-data with other parameters
> 
> 
> I am attempting to upload a file using enctype="multipart/form-data". 
> However, when that enctype is specified, I cannot access any of the 
> other parameters like normal using the request.getParameterValues() 
> method. Is there another way I should be accessing those parameters 
> from OpenCMS when combined with file uploads?
> 
> Sample Code:
> 
> Form :
> ------------
> 
> <form name="" method="POST" action="" enctype="multipart/form-data"> 
> <input type="text" name="text_1"> <input type="file" name="file1"> 
> </form>
> 
> Parameter Code:
> ---------------
> public String[] getCleanParameter(HttpServletRequest request, String
> parameter) {
> 	return = request.getParameterValues(parameter);
> }
> 
> Chase Urich
> Web Programmer
> LeTourneau University _______________________________________________
> 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
_______________________________________________
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