login about faq

I am using the latest library “chilkat-9.5.0-armv6-linux.tar.gz” 30 days trial version. I collected a multipart response and dumped into the file and then was able to parse it using "mime.LoadMimeFile()”. But if I store the multipart response into a local memory buffer and try to parse it using "mime.LoadMime()", it fails. The multipart response in first part contains audio data in WAV format and in second part it has a text/plain. It looks like that "mime.LoadMime" is not able to load all available data into mime. Is there a way to parse multipart data using chilkat library? My multipart data is: --myBoundary Content-Type: audio/x-wav

RIFFÔ WAVEfmt    €> }  data® ÿÿÿÿ ÿÿÿÿ ÿÿÿÿ   þÿ ÿÿ ÿÿ    
--myBoundary Content-Type: text/plain; charset=utf-8 { my text is here. }

Appreciates your help.

asked Dec 08 '15 at 00:03

Prashant's gravatar image


I suspect this is the problem: The MIME contains binary (non-text) data in 8bit encoding. In other words, it is binary MIME that is not using base64 content encoding for the WAV data.

LoadMime is expecting a string, and a string must be something where the bytes represent characters. Therefore, LoadMime should only be used when the MIME does not contain raw non-character byte data.

If the MIME is binary, then the correct method to call is LoadMimeBytes. First load the MIME bytes into a CkByteData object (or have the CkByteData "borrow" the bytes to avoid copying, if copying is more than a negligible task), and then pass the CkByteData object to LoadMimeBytes.


answered Dec 08 '15 at 12:11

chilkat's gravatar image

chilkat ♦♦

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: Dec 08 '15 at 00:03

Seen: 974 times

Last updated: Dec 08 '15 at 12:11

powered by OSQA