Customer login  |   Contact us
Home Company Products Support Purchase
Forum Home » Survey software » Opinio plugins

Topic: file upload
Replies: 0   Pages: 1  


Back to Topic List Back to Topic List Topics: [ Previous | Next ]
Replies: 0   Pages: 1  
atom

Posts: 1
Registered: Mar 21, 2011
file upload
Posted: Mar 21, 2011 3:33 PM
  Reply

Hi all,
I'm trying to develop a file upload function in my plugin.
but I have an error:

Here is my getFunctionHTML()

String fname = PluginConstants.PARAM_UPLOAD_FILE_NAME_1;
pluginFunctionHTML.append("<table>");
pluginFunctionHTML.append("<tr><td class=\"form label\">Upload Code (.csv):</td>")
.append("<td class=\"form value\" method=\"post\" >")
.append("<INPUT TYPE=\"file\" class=width200 name=\"").append(fname).append("\" enctype=\"multipart/form-data\" value=\"\">")
.append("</td></tr>")
.append("<tr><td class=buttons><INPUT TYPE=submit class=button value='Ok'></td></tr></table>")

and here is my processFunctionHTML()

File firstUploadedFile = null;
ArrayList uploadFiles = (ArrayList) resources.get(PluginConstants.RESOURCE_UPLOAD_FILES);
if (uploadFiles != null && uploadFiles.size() > 0) {
firstUploadedFile = (File) uploadFiles.get(0);

PluginUtil.info("fileUploaded: " + firstUploadedFile.getAbsolutePath() + firstUploadedFile.getName());
}

I have the following exception when I pres the Submit button:
21 Mar 2011 13:57:03 -- ERROR -- Servlet.service() for servlet action threw exception
java.lang.IllegalArgumentException: Cannot invoke com.objectplanet.survey.view.admin.setup.PluginForm.setPlugin_uploadFiles - argument type mismatch
at org.apache.commons.beanutils.PropertyUtilsBean.invokeMethod(PropertyUtilsBean.java:1778)

any idea?
thanks all very much



© 1998-2017 ObjectPlanet, Inc. Øvre Slottsgate 5, 0157 Oslo, Norway Tel (+47) 2233 3360 | Fax (+47) 2233 3361