Wow, you've been busy. Just getting back to
look at what has been suggested. I did a little
poking around on the internet and found:

http://www.experts-exchange.com/Web/Web_Languages/HTML/Q_20398679.html

It uses 2 forms to do this. Can't get it to (really) work.
Can't get yours to work either.

I have a little bit of JSP that has worked just fine:

<html:form style="margin-bottom:0;" method="POST" enctype="multipart/form-data" action="/UploadAttachment.do">
<html:file property="file"/>
<html:submit value="Attach"/>
</html:form>


Then, I tried tinkering with it, as follows:

<html:form style="margin-bottom:0;" method="POST" enctype="multipart/form-data" action="/UploadAttachment.do">
<input type='file' name='browse' style='display: none;'>
<input type='text' name='file'>
<input type='image' onClick='browse.click();file.value=browse.value;' src='images/browse_button.gif'>
<html:submit value="Attach"/>
</html:form>


This throws an exception, as follows:

exception

javax.servlet.ServletException: BeanUtils.populate
org.apache.struts.util.RequestUtils.populate(RequestUtils.java:497)
org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:798)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:205)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1158)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)



root cause

org.apache.commons.beanutils.ConversionException: Cannot assign value of type 'java.lang.String' to property 'file' of type 'org.apache.struts.upload.FormFile'
org.apache.struts.action.DynaActionForm.set(DynaActionForm.java:424)
org.apache.commons.beanutils.PropertyUtilsBean.setSimpleProperty(PropertyUtilsBean.java:1733)
org.apache.commons.beanutils.PropertyUtilsBean.setNestedProperty(PropertyUtilsBean.java:1648)
org.apache.commons.beanutils.PropertyUtilsBean.setProperty(PropertyUtilsBean.java:1677)
org.apache.commons.beanutils.BeanUtilsBean.setProperty(BeanUtilsBean.java:1022)
org.apache.commons.beanutils.BeanUtilsBean.populate(BeanUtilsBean.java:811)
org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:298)
org.apache.struts.util.RequestUtils.populate(RequestUtils.java:495)
org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:798)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:205)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1158)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)


Maybe this is just some configuration thing I need to do, don't know yet.

Dean Hoover

Michael McGrady wrote:

So far I have this, Erik, which works in IE but not in Mozilla. Anyone have any other ideas on this? I did this before but lost it in a computer crash.

<form method="get" action='boogie-woogie'>
<input type='file' name='browse' style='display: none;'>
<input type='text' name='file'>
<input type='image' onClick='browse.click();file.value=browse.value;' src='browse.gif'>
</form>


Michael


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]





--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to