Hello all,

I have a web application with a file upload form which is processing the uploaded data on the server in two ways: One needs to get Base64-data and the other one, which is totally optionally, may has to send a mail with some text and the binary as a attachment afterwards. It is possible and more likely that the first way to process the data has to be repeated for different recipients many times and that the uploaded data is quite big, speaking of maybe even hundreds of MB. In this case it is very unlikely that processing the files for mails is configured.

Because of this I decided to encode the binary data directly after the upload to Base64 and afterwards delete the original data to save memory. If the data has to be send by mail it will just get decoded from Base64 to binary and given to MIME::Lite.

My question now is if there is a way to give pre encoded Base64 data to MIME::Lite with the original mime type of the file, e.g. "image/png" or else, with MIME::Lite doesn't reencode the given data on its own? It should send a mail with content-transfer-encoding Base64, but directly with my provided Base64 data. After reading the documentation it looks like MIME::lite encodes on its if non-text mime-types are given. Any ideas?

Thanks!


In reply to MIME::Lite and pre-encoded Base64 binary data by Pickwick

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.