Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

FormFile

 
jonathan Greens
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if I get a FormFile, is there any easy way in struts to write it to the disk?
I know i can use formFile.getFileData() as a byte[] then maybe use java.io. But is there a better way?
thanks
 
Ray Stojonic
Ranch Hand
Posts: 326
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
as of Struts 1.2 you should be using commons-upload instead
 
sreenath reddy
Ranch Hand
Posts: 415
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
there is one method in form file which directly gives u the inputstream rather than reading thorugh bytes
 
jonathan Greens
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks guys. I am using struts 1.1. i guess it's time to migrate to 1.2
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic