[rt-users] Problems with attachment

Mittag Christian christian.mittag at siemens.com
Thu Jan 15 05:17:29 EST 2004


Hi,

We are having problems with xls-attachments, using rt 3.0.6 with Apache 1.3.29, mod_perl 1.29, perl 5.8.1 (with the IO::Stringy-hack from Jesse) on SuSE-Linux SLES8. 
(I know, we better should use rt 3.0.8, but we just upgraded from rt 1.0 two months ago.)

Some attachments (excel-sheets) are utf8-encoded in the database, which shouldn't be like that.
Therefore I put into Ticket/Attachment/dhandler something like:

    $m->clear_buffer();
+   my $d = Encode::decode_utf8($data);
+   if ($d) {
+      $data=$d;
+   }
    $m->out($data);

The decode_utf8 is working as expected (I have checked that by doing an
additional $data=MIME::Base64::encode_base64($d) in the example above and/or 
writing the result into a tmp-file). However, the m->out($data) is doing an utf8-encoding
again and the result looks the same as before.

Is there a way, to prevent this utf8-encoding on the way out and get the data in binary-form?

We are having tickets with similar xls-attachments, which are stored in "binary"-form in the
database. 
These ones can be opened in the browser correctly and everything is fine.
The "Content-Type" is set to "application/vnd.ms-excel" in both cases.


Does anybody have some ideas or hints, what one can be done, so that the data is sent in binary form
with $m-out() ??


Thanks in advance!
 
Christian Mittag

--
Christian Mittag     
Siemens Business Services             
D-81739 Muenchen,    Otto-Hahn-Ring 6
mailto:Christian.Mittag at siemens.com
 



More information about the rt-users mailing list