HttpServletRequest request = (HttpServletRequest) objectModel.get(HttpEnvironment.HTTP_REQUEST_OBJECT);
contentType = request.getContentType();
if (contentType == null) {
contentType = parameters.getParameter("defaultContentType", null);
}
if (contentType == null) {
throw new Exception("ERROR");
} else if (contentType.startsWith("application/x-www-form-urlencoded") || contentType.startsWith("multipart/form-data")) {
String parameter = parameters.getParameter(FORM_NAME, null);
if (parameter == null) {
throw new Exception("ERROR");
}
String sXml = request.getParameter(parameter);
inputSource = new InputSource(new FileInputStream(sXml));
} else if (contentType.startsWith("text/plain") || contentType.startsWith("text/xml") || contentType.startsWith("application/xml")) {
len = request.getContentLength();
if (len > 0) {
PostInputStream anStream = new PostInputStream(request.getInputStream(), len);
inputSource = new InputSource(anStream);
} else {
throw new SyspeoException("ERROR);
}
} else {
throw new SyspeoException("ERROR);
}InputStream is = inputSource.getByteStream();
This code is adapted from StreamGenerator. An action can do the same.
Lionel
At 15:04 22/01/2004 +0100, you wrote:
Hello list ;=) Do you know if Cocoon handles multipart form like* <form action="doaction"> <input type="file" /> <input type="text"/> </form>
I can't find the answer in the documentation.
Thanks for your answer.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Lionel CRINE Ing�nieur Syst�mes documentaires Soci�t� : 4DConcept 22 rue Etienne de Jouy 78353 JOUY EN JOSAS Tel : 01.34.58.70.70 Fax : 01.39.58.70.70
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
