cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

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.

0 Likes
View Entire Topic
Former Member
0 Likes

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();

}