Hi,

            I am trying to implement file upload using struts.

I added the following to Dyna Validator Form:

<form-property name="importFile" type="org.apache.struts.upload.CommonsMultipartRequestHandler$CommonsFormFile" />

 

Can anybody please let me know how can I get InputStream in my Action class.

Also, what do I need to import?

 

 

 

This is what I tried doing:

….

….

 

FormFile myFile = (FormFile)dynaValidatorform.get("importFile");

InputStream is = myFile.getInputStream();

….

….

 

 

I am getting this exception:

 

java.rmi.UnmarshalException: java.io.ByteArrayInputStream; nested exception is:

        java.io.NotSerializableException: java.io.ByteArrayInputStream

        at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(Lweblogic.rmi.extensions.server.RemoteReference;Lweblogic.rmi.extensi

ons.server.RuntimeMethodDescriptor;[Ljava.lang.Object;Ljava.lang.reflect.Method;)Ljava.lang.Object;(ReplicaAwareRemoteRef.java:297

)

 

 

Thanks,

-M