Hi there,
Try to specify enctype on the form:
enctype="multipart/form-data"
Also, you need to configure stripes to use commons multipart wrapper:
<init-param>
<param-name>MultipartWrapper.Class</param-name>
<param-value>net.sourceforge.stripes.controller.multipart.CommonsMultipartWrapper</param-value>
</init-param>
in your web.xml
Cheers,
Alex.
On Wed, Apr 1, 2009 at 1:36 AM, Sneha Manohar <[email protected]> wrote:
>
> Hi All,
> Thanks for your previous help . I wish to upload image in from JSP & store it
> on local disk .
> Can I use FileBean for uploading images. I need some help in this direction.
>
> I tried doing something like this ..
>
> profile.jsp
>
> <stripes:form action="Register.action">
> <td class="c0">Image profile:</td>
> <td class="c1">
> <stripes:file name="newIamge"/>
> </td>
> <stripes:submit class="btnProfile" name="modify" value="Modify" /></td>
>
> In the RegisterActionBean ,I say
> File f= new File("c:\user");
> public Resolution modify(){
> setUser(this.user);
> if(this.getNewImage() != null){
> try{
> System.out.println("Inside the modify");
> newImage.save(newFile);
> System.out.println("after the modify");
> }catch(IOException io){
> io.printStackTrace();
> }
> }else{
> System.out.println("Inside else"+this.getNewImage());
> }
>
> This does not work...I get this.getNewImage()) as null
>
> Thanks
> sneha
> ________________________________
> Add more friends to your messenger and enjoy! Invite them now.
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Stripes-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/stripes-users
>
------------------------------------------------------------------------------
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users