Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Struts and the fly likes Hi Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Hi " Watch "Hi " New topic
Author

Hi

K Koteswara Rao
Greenhorn

Joined: Oct 15, 2012
Posts: 6
Hi All ,

Any one send me code for multiple file upload functionolity in struts 1.3
jatan bhavsar
Ranch Hand

Joined: Jul 23, 2008
Posts: 296

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

Joined: Oct 15, 2012
Posts: 6
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

Joined: Jul 10, 2012
Posts: 50
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.


 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hi
 
Similar Threads
UML component case study
whats the cost of IBM's XML certification Voucher?
Just passed with 84% half an hour ago
Passed SCJP 1.5 with 100%
Amdocs - cyprus ... any views