
Hi All,
I want to upload file using struts framework. the request should be came from standalone application using HttpUrlConnection.
How can i write my struts(1.3) action code to handled Multipart form data. I used FormFile and is working fine with struts jsp (property file of FormFile). But not working with HttpUrlConnection.
However if i writter a Servlet and take input stream from request (request.getInputStream()) it works fine.
Is any one has solution please provide me.
Thanks Paresh

Hi Friend,
Please visit the following link:
http://www.roseindia.net/struts/strutsfileupload.shtml
Thanks

Hi,
thanks for a quick reply....
but my major problem is with client request...how can i write a client code which is standalone application..
I have written code using java.net.URL and java.net.URLConnection .
In this case FormFile was not get set. so it send null pointer exception while formfile.getFile(); and also if i used request.getInputstream() is return 0 bytes.
what is another way to handled request stream in struts action or let me how the upload request is post to struts action.
Thanks

Hi,
thanks for a quick reply....
but my major problem is with client request...how can i write a client code which is standalone application..
I have written code using java.net.URL and java.net.URLConnection .
In this case FormFile was not get set. so it send null pointer exception while formfile.getFile(); and also if i used request.getInputstream() is return 0 bytes.
what is another way to handled request stream in struts action or let me how the upload request is post to struts action.
Thanks

Hi,
thanks for a quick reply....
but my major problem is with client request...how can i write a client code which is standalone application..
I have written code using java.net.URL and java.net.URLConnection .
In this case FormFile was not get set. so it send null pointer exception while formfile.getFile(); and also if i used request.getInputstream() is return 0 bytes.
what is another way to handled request stream in struts action or let me how the upload request is post to struts action.
Thanks
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.