Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hi

 
K Koteswara Rao
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All ,

Any one send me code for multiple file upload functionolity in struts 1.3
 
jatan bhavsar
Ranch Hand
Posts: 299
Eclipse IDE Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

No one will send the code here .. try search on google implement the example and come with the problems. its not code mill.

Jatan
 
K Koteswara Rao
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi i want to store multiple files into server .but it will not work,can any one help me .i have writen code like this

List<String> attachmentFileName=formManagementBean.getAttachmentFileName();
List<File> attachment=(List)formManagementBean.getAttachment();

if(attachment !=null){
String filePath = getServlet().getServletContext().getRealPath("/")+ "uploadfiles";
File folder = new File(filePath);
if (!folder.exists()) {
folder.mkdir();
}


for(File file:attachment)
{
File savedFile = new File( file,filePath);
ByteArrayOutputStream arrayOutput = new ByteArrayOutputStream();
FileOutputStream fos = new FileOutputStream(savedFile);
bufferedOutput = new BufferedOutputStream(fos);
processedByte = inuputSt.read(theByte, 0, theByte.length);

do {
arrayOutput.write(theByte);
processedByte = inuputSt.read(theByte);
} while (processedByte != -1);

bufferedOutput.write(arrayOutput.toByteArray());
bufferedOutput.flush();
bufferedOutput.close();
 
Pyla Rao
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
K Koteswara Rao, welcome to the Ranch

you are new,so use right subject and use code tags to your post, and you can see how much better it looks.

Please explain where you are facing problem in your program then surly we can help you.


 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic