• Post Reply Bookmark Topic Watch Topic
  • New Topic

Multiple Attachment  RSS feed

 
nandhini sruthi
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I got the following error while sending attachment
ERROR.....java.lang.ArrayIndexOutOfBoundsException: 5

I am using 5 browse.. for attach file
if i attach 5 file paths means multiple attachment working properly,but if i attach 1 or 2 file paths i got the error.

i post my code here



[EJFH: Code was all on one long line!]
[ February 27, 2008: Message edited by: Ernest Friedman-Hill ]
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is wrong:

for(int i = 0; i<= filename.length; i++)

If filename is 5 elements long, this will execute 6 times: 0, 1, 2, 3, 4, 5. You want

for(int i = 0; i< filename.length; i++)
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!