Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

MIME::Lite and pre-encoded Base64 binary data

by Pickwick (Beadle)
on Jun 08, 2012 at 16:11 UTC ( [id://975202]=perlquestion: print w/replies, xml ) Need Help??

Pickwick has asked for the wisdom of the Perl Monks concerning the following question:

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!

Replies are listed 'Best First'.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://975202]
Approved by herveus
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2024-03-19 07:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found