forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leo" <leont...@tstt.net.tt>
Subject RE: Problem : enctype="multipart/form-data"
Date Wed, 24 Sep 2003 20:48:12 GMT
Hi folks

Sometimes things are right under your nose.
   <init-param>
      <param-name>enable-uploads</param-name>
      <param-value>true</param-value>
    </init-param>
I changed the above in my web.xml (which matches what is in eXist)
and I am able to now store documents in my eXist databse 
which is embedded in forrest.
 
Leo


-----Original Message-----
From: Leo [mailto:leontyne@tstt.net.tt]
Sent: Tuesday, September 23, 2104 6:09 AM
To: forrest
Subject: Problem : enctype="multipart/form-data"


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
(request.getRequestURI())</xsp:expr></xsp:attribute>
      <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>
      <input type="submit" name="action" value="store"/>
</form>

There is aslo the following:
<xsp:logic>
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) {}
}
...
</xsp:logic>


I have the following in my web.xml file in the WEB-INF directory
    <init-param>
      <param-name>enable-uploads</param-name>
      <param-value>false</param-value>
    </init-param>





Regards
Leo



Mime
View raw message