• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Multiple Attachment

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
author and iconoclast
Posts: 24203
44
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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++)
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic