UUEncoded attachment

Hi everybody,

i hope this is the right place to ask, i have some problem when saving UUEncoded attachment, this is how i handle attachment saving:

publicvoid createFile(String fileName, InputStream fis){

OutputStream fos;

File fl;

try{

if (fis ==null || fis.available() < 0){

return;

}

fl =new File(this.fullWorkingPath + fileName);

fos =new FileOutputStream(fl);

try{

int i = 0;

while ((i = fis.read()) != -1){

fos.write(i);

}

}catch (Exception e){

fis.close();

fos.close();

e.printStackTrace();

}

fos.close();

fis.close();

}catch (Exception e){

e.printStackTrace();

}finally{

fl =null;

}

}

and this is the exception i get in fis.read():

java.io.IOException: UUDecoder error: No Begin

at com.sun.mail.util.UUDecoderStream.readPrefix(UUDecoderStream.java:130)

at com.sun.mail.util.UUDecoderStream.read(UUDecoderStream.java:61)

has anyone any idea about this?

Thank you for your time :)

[2026 byte] By [SpYk3a] at [2007-11-26 15:21:23]
# 1

Looks like the message wasn't encoded correctly.

uuencoded attachments are completely non-standard,

so it's not surprising that some applications do such

encoding incorrectly. Really, modern applications shouldn't

be using uuencoding at all. If you have any control over the

application that created the message, you should fix it.

bshannona at 2007-7-8 21:36:10 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...