The only place I am using a fileIO stream is when I am adding the InputStream to the MimeBodyPart... so I am confused as to where I would flush or close anything. After more testing with a text file, it copies everything after the first carriage return. I have no idea what would be causing it to ignore everything before the first carriage return... Below is the code:
String emailHost = getServlet().getServletContext().getInitParameter("EmailHost"); String emailFrom = getServlet().getServletContext().getInitParameter("EmailFrom"); MimeBodyPart[] attachments = new MimeBodyPart[form.getAttachments().size()]; for(int i=0;i<form.getAttachments().size();i++) { FormFile file = (FormFile)form.getAttachments().elementAt(i); file.getInputStream().close(); attachments[i] = new MimeBodyPart(file.getInputStream()); attachments[i].setFileName(file.getFileName()); attachments[i].setDisposition(MimeBodyPart.ATTACHMENT); } emailService.sendEmail(emailHost,emailFrom,form.getSubject(),form.getBody(), formatEmail(form.getTo()),formatEmail(form.getCc()),formatEmail(form.getBcc( )),attachments); -----Original Message----- From: Rick Reumann [mailto:[EMAIL PROTECTED] Sent: Thursday, March 06, 2003 1:49 PM To: Struts Users Mailing List Subject: Re: Problems with FormFile.getInputStream() On Thu, 6 Mar 2003 13:20:08 -0500 Eva Sager <[EMAIL PROTECTED]> wrote: > The file that ends up being attached is the correct file, it is just > that the top portion of it is cut off... Probably a dumb question, but are you sure there are no spots where you are missing flushing or closing some kind of fileIO stream? -- Rick Reumann --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]