struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eva Sager <Eva.Sa...@aelera.com>
Subject RE: Problems with FormFile.getInputStream()
Date Thu, 06 Mar 2003 19:55:36 GMT
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:maillist@reumann.net]
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 <Eva.Sager@aelera.com> 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: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message