Thanks Scott.
        The problem is resolved. 

        I was using Javascript to set the encoding type as follows:
                document.form1.enctype = "multipart/form-data";
        Then I corrected it to 
                document.form1.encoding = "multipart/form-data"; 
        And it worked.

thank you for your help.

-----Original Message-----
From: Scott Yeadon [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 20, 2004 6:22 AM
To: [EMAIL PROTECTED]
Subject: Re: problem with file upload


Don't think so, the only control I think is via the form 
definition...what you could do though is determine what type of object 
is coming through...

Try outputting the classname of the object that you get back from the 
request: System.out.println(request.get("uploadfile").getClass().getName());
At least then you'll know what you're dealing with so you can cast it 
correctly.

Scott.

Jain, Neeraj wrote:

>Thanks for your response.
>I am storing the uploadfile attribute as file, as follows:
>
><input type="file"  name ="uploadfile"></input>.
>
>Is there any other place where I can set the storing type.
>
>Regards,
>Neeraj.
>
>-----Original Message-----
>From: Scott Yeadon [mailto:[EMAIL PROTECTED]
>Sent: Friday, October 15, 2004 6:51 AM
>To: [EMAIL PROTECTED]
>Subject: Re: problem with file upload
>
>
>Sounds like "uploadfile" isn't of the type you're casting it to - maybe
>check where you're setting the "uploadfile" request attribute that it's 
>the object type you think it is...e.g. maybe you're storing in the 
>request a PartOnDisk but erroneously casting to PartInMemory when you do 
>the "get"?
>
>Scott.
>
>Jain, Neeraj wrote:
>
>  
>
>>Version: cocoon-2.1-M1.jar
>> 
>>I get classcastexception while attempting to upload a file. Following 
>>is the stacktrace
>> 
>>       at com.mypackage.FileUploadAction.act(FileUploadAction.java:275)
>>       at 
>>org.apache.cocoon.components.treeprocessor.sitemap.ActTypeNode.invoke
>>(ActTypeNode.java:133)
>>       at
>>org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNo
>>de.invokeNodes(AbstractParentProcessingNode.java:84)
>>       at 
>>org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNod
>>e.invoke(PreparableMatchNode.java:164)
>>       at 
>>org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNo
>>de.invokeNodes(AbstractParentProcessingNode.java:108)
>> 
>>Line 275 in FileUploadAction.java is
>>
>>         PartInMemory filePart = (PartInMemory)
>>request.get("uploadfile");
>> 
>>    
>>
>
>
>
>---------------------------------------------------------------------
>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]
>
>  
>


---------------------------------------------------------------------
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