You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Mike Dickson <mi...@yahoo.com> on 2005/01/12 21:47:57 UTC

Corrupt .WAV on Linux

Are there any differences between POSTing parameters from/to Windows and
Linux in Cocoon?  The param comes in as a String is there a different
default character set conversion going on?  The machine POSTing the .wav
file is running Windows.  When it POSTs to a Linux box are there some
issues?

Background:
  I have a Cocoon application running just fine on Windows.  It gets a .WAV
file POSTed to a custom Action and I email it off as a binary email
attachment (See below.)  All is fine.  I store the parameter (.wav file) as
a BLOB in MySQL by doing a param.getBytes().  When I move the code up to my
Linux box server, ANT everything and run it, I get nasty garbled .WAV files
that play ok but sound terrible.

Windows Environment:
    Window 2000
    Jdk 1.4.2_06
    Tomcat 4.1
    Cocoon (Front end)
    Hibernate (Back end)
    SMTP Sendmail on Linux Box  (I connect to it.)
    MySQL on Linux Box  (I connect to it.)

Linux Environment:
    RedHat 9
    Jdk 1.4.2_06
    Tomcat 4.1
    Cocoon (Front end)
    Hibernate (Back end)
    SMTP Sendmail on Linux Box  (I connect to it locally)
    MySQL on Linux Box  (I connect to it locally)




Email Code:
  Address replyToList[] = { new InternetAddress(replyTo) };

  Message newMessage = new MimeMessage(session);

  newMessage.setRecipients(Message.RecipientType.TO, toList);

  newMessage.setFrom(new InternetAddress(from,from));

  newMessage.setSubject(subject);

  newMessage.setReplyTo(replyToList);

  newMessage.setSentDate(new Date());

  MimeBodyPart messageTextPart = new MimeBodyPart();

  buildHTMLResponse(messageTextPart);

  MimeBodyPart mimeAttachmentPart = new MimeBodyPart();

  DataSource source = new ByteArrayDataSource(attachmentName,
attachmentMIMEType, attachment);

  DataHandler dataHandler = new DataHandler(source);

  mimeAttachmentPart.setDataHandler(dataHandler);

  mimeAttachmentPart.setFileName(attachmentName);

  Multipart multipart = new MimeMultipart();

  multipart.addBodyPart(messageTextPart);

  multipart.addBodyPart(mimeAttachmentPart);

  newMessage.setContent(multipart);


  Transport transport = session.getTransport("smtp");

  transport.connect(host, user, password);

  transport.sendMessage(newMessage, toList);

Cocoon Linux Parameter Issues? (Was Corrupt .WAV on Linux)

Posted by Mike Dickson <mi...@yahoo.com>.
Are there any differences between POSTing parameters from/to Windows and
Linux in Cocoon?  The param comes in as a String is there a different
default character set conversion going on?  The machine POSTing the .wav
file is running Windows.  When it POSTs to a Linux box are there some
issues?

Background:
    I have a Cocoon application running just fine on Windows.  It gets a
.WAV file POSTed to a custom Action and I email it off as a binary email
attachment (See below.)  All is fine.  I store the parameter (.wav file) as
a BLOB in MySQL by doing a param.getBytes().  When I move the code up to my
Linux box server, ANT everything and run it, I get nasty garbled .WAV files
that play ok but sound terrible.

Windows Environment:
    Window 2000
    Jdk 1.4.2_06
    Tomcat 4.1
    Cocoon (Front end)
    Hibernate (Back end)
    SMTP Sendmail on Linux Box  (I connect to it.)
    MySQL on Linux Box  (I connect to it.)

Linux Environment:
    RedHat 9
    Jdk 1.4.2_06
    Tomcat 4.1
    Cocoon (Front end)
    Hibernate (Back end)
    SMTP Sendmail on Linux Box  (I connect to it locally)
    MySQL on Linux Box  (I connect to it locally)




Email Code:

Address replyToList[] = { new InternetAddress(replyTo) };
Message newMessage = new MimeMessage(session);
newMessage.setRecipients(Message.RecipientType.TO, toList);
newMessage.setFrom(new InternetAddress(from,from));
newMessage.setSubject(subject);
newMessage.setReplyTo(replyToList);
newMessage.setSentDate(new Date());
MimeBodyPart messageTextPart = new MimeBodyPart();
buildHTMLResponse(messageTextPart);
MimeBodyPart mimeAttachmentPart = new MimeBodyPart();
DataSource source = new ByteArrayDataSource(attachmentName,
attachmentMIMEType, attachment);
DataHandler dataHandler = new DataHandler(source);
mimeAttachmentPart.setDataHandler(dataHandler);
mimeAttachmentPart.setFileName(attachmentName);
Multipart multipart = new MimeMultipart();
multipart.addBodyPart(messageTextPart);
multipart.addBodyPart(mimeAttachmentPart);
newMessage.setContent(multipart);
Transport transport = session.getTransport("smtp");
transport.connect(host, user, password);
transport.sendMessage(newMessage, toList);


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org