I have a file upload component and one button in a view.
I have created a binary type context element and mapped it with fileupload component.while clicking the submit button I am getting " Parse method is not possible for this type" exception.
help me out.
Request clarification before answering.
Hi sridhar,
Use this code for Upload
context u create one attribute(up),u assign the data type as "Resource"(which is dictionary type)
InputStream text = null;
int temp = 0;
try
{
File file = new File(wdContext.currentContextElement().getUp().getResourceName());
FileOutputStream op = new FileOutputStream(file);
if(wdContext.currentContextElement().getUp()!=null)
{
text = wdContext.currentContextElement().getUp().read(false);
while((temp=text.read())!=-1)
{
op.write(temp);
}
}
op.flush();
op.close();
}
catch(Exception e)
{
e.printStackTrace();
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.