forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leo" <>
Subject Problem : enctype="multipart/form-data"
Date Tue, 23 Sep 2104 10:08:37 GMT
Hi folks

I am still on forrest 0.4(have not upgraded to 0.5 as yet)

The following is an excerpt from the xsp page: xadmin.xsp
which come with eXist XML database. It works fine if I use
straight from exist and I can access all forms.

I embedded the page in forrest.
I modified sitemap.xmap to access page xadmin.xsp.
It works partially in that I can
	login to the database
	view and update users
	browse collections
but view user / browser collections have forms using the method="get"

The Problem
The Add Document function uses a form with
method="post" enctype="multipart/form-data".
Nothing happens when I click the submit button on this form

See excerpt :
The form part is basically as follows
<form name="upload" method="post" enctype="multipart/form-data">
  	<xsp:attribute name="action"><xsp:expr>response.encodeUR
      <input type="file" size="40" name="uploaded_file"/>
      <input type="text" name="filename" value="" size="20"/>
	<input type="checkbox" name="overwrite" checked="true">
                        Overwrite existing document with same name
      <input type="submit" name="action" value="store"/>

There is aslo the following:
else if(action.equals("store"))
Part file = (Part)request.get("uploaded_file");
String overwrite = request.getParameter("overwrite");
overwrite = (overwrite == null ? "false" : "true");
String fileName = request.getParameter("filename");
if(fileName == null || fileName.length() == 0)
fileName = file.getUploadName();
fileName = new File(fileName).getName();

String source = null;
try {
source = XMLUtil.readFile(file.getInputStream(), "ISO-8859-1");
} catch(Exception e) {}

I have the following in my web.xml file in the WEB-INF directory


View raw message