mime

inline images in email using javamail

I want to send an email with an inline image using javamail. I'm doing something like this. MimeMultipart content = new MimeMultipart("related"); BodyPart bodyPart = new MimeBodyPart(); bodyPart.setContent(message, "text/html; charset=ISO-8859-1"); content.addBodyPart(bodyPart); bodyPart = new MimeBodyPart(); DataSource ds = new Byte...

Directly embedding JPEGs in an HTML file

I can embed a mime encoded JPEG in an html page by saving the page from IE using the File-SaveAs menu and selecting (Web Archive, single file (*.mht)). Renaming this .mht file with .eml enables Outlook to open it and send an HTML email. My questions are: How can I embed JPEG images directly in HTML pages (no external files). Are the...

images served with content-disposition: inline are being shown as attachments

I've observed this behaviour on gmail and yahoo, but my concern is gmail anyway. This is the header of the image mime part that I'm sending. Content-Type: image/jpeg; name=image0.jpeg Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename=image0.jpeg Content-ID: <image0> Gmail seems to modify the headers for some reaso...

How to get file content-type with PHP < 5.3?

How do I retrieve the content-type of a file using PHP? I don't want to rely on the file extension alone. Thanks! ...

Parsing simple MIME files from C/C++?

Hello everyone, I have searched the web for days now but I can't seem to find a good solution to my problem: For one of my projects I'm looking for a good (lightweight) MIME parser. My customer provides MIME formatted files (linear, no hierarchy) which contain 3-4 "parts". The application must be able to split those parts and process t...

How to add a MIME handler to Firefox and Internet Explorer from an installer

I'm looking to create an installer that will add a handler for a MIME type in Firefox and Explorer. The installer I will be using will be either INNO (a.k.a Oh Nooo!) or NSIS. How do Mozilla and Microsoft recommend adding a handler. So far all I have been able to find for Firefox is how to Add/Remove/Augment manually which no matter how...

How to add a MIME handler to Firefox and Internet Explorer from an installer

I'm looking to create an installer that will add a handler for a MIME type in Firefox and Explorer. The installer I will be using will be either INNO (a.k.a Oh Nooo!) or NSIS. I'm looking for for how Mozilla and Microsoft recommend adding the handler. So far all I have been able to find for Firefox is how to Add/Remove/Augment manually ...

Parsing email with Python

I'm writing a Python script to process emails returned from Procmail. As suggested in this question, I'm using the following Procmail config: :0: |$HOME/process_mail.py My process_mail.py script is receiving an email via stdin like this: From hostname Tue Jun 15 21:43:30 2010 Received: (qmail 8580 invoked from network); 15 Jun 2010 2...

MIME RFC "Content-Type" parameter confusion? Unclear RFC specification.

Hello, I'm trying to implement a basic MIME parser for the multipart/related in C++/Qt. So far I've been writing some basic parser code for headers, and I'm reading the RFCs to get an idea how to do everything as close to the specification as possible. Unfortunately there is a part in the RFC that confuses me a bit: From RFC882 Sectio...

Apache serving wrong Content-Type for Rails files

Apache keeps serving up my Rails files with a Content-Type of 'text/plain' in the header. I have mod_mime installed, a mime.types files with all the correct MIME assignments, and the following code in my configuration. Any thoughts? DefaultType text/plain <IfModule mime_module> TypesConfig /etc/apache2/mime.types AddType applic...

mime decode pdf quoted-printable

Hi, I've been building a simple ticket system and it's all done and working except for when it receives PDF files via email that have been sent using quoted-printable encoding. I've tried using quoted_printable_decode(), the quoted-printable.decode stream filter, the later just created an empty file. I've also tried using $input = preg_...

Parse and display MIME multipart email on website

I have a raw email, (MIME multipart), and I want to display this on a website (e.g. in an iframe, with tabs for the HTML part and the plain text part, etc.). Are there any CPAN modules or Template::Toolkit plugins that I can use to help me achieve this? At the moment, it's looking like I'll have to parse the message with Email::MIME, th...

How do I generate a multipart/mime message with correct CRLF in Python?

I need to generate a multipart/mime message to send as a response to a HTTP request but am hitting either a bug or limitation in the Python email.* package. The problem is that using Python 2.6, the message.as_string() call below generates a string with \n rather that CRLF as the line endings: message = MIMEMultipart() for image in ima...

C++ gsoap mime/dime for binary files in windows

Hello, I'm pretty close to losing my head here ;) I'm developing a service that uses gsoap. I would like to return a mime response. I have everything working, but when reading binary files, all kind of files like jpeg, pdf, etc... contains the \0 char several times over the data (if opened with notepad can see a lot of NUL). So any c...

MIME type handling in uploading a serving files through attachment_fu

I'm currently using attachment_fu to handle file uploads, and while the plugin provides a nice catchall for images in :content_type => [:image], nothing similar seems to exist for broader buckets. None of the uploads will be executed, per se, only saved to disk and served back at a later time. So a few related questions. Is there any ...

IE6 can't download file

I've written a Web server that serves various kinds of content. When sending back a JSON or CSV file, IE6 is unable to save the file. Firefox 3.6 and IE8 save those files just fine. The server uses the text/json Content-type for JSON and text/csv for CSV files. I've tried changing the Content-type to text/plain -- no difference. IE6...

Re-assemble email messages encoded in 'message/partial' with Python

Is there a way to reassemble in Python email messages that are encoded with Content-Type: message/partial (i.e. section '7.3.2. The Message/Partial subtype' of RFC 1521)? In particular, given a set of emails, how can one merge them back into an original? i.e. emails = [...] # a list of `email`. reassembled_email = merge_emails(emails...

Findout if a default viewer exist

I know how to lunch another activity, But how do I meke sure an activity exist for my MIME type before starting the activity? for example if I have a PDF file that I want to display, how do I make sure a PDF viewer exist? here is the code I use to lunch the PDF viewer MimeTypeMap tMimeType = MimeTypeMap.getSingleton(); String tMimeStr ...

Protocol Buffers MIME problem

Help! Trying to implement Protocol Buffers via Rest (Jersey), but get this exception. class com.util.ProtobufMessageBodyReader class com.util.ProtobufMessageBodyWriter Jul 6, 2010 3:43:37 PM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-9102 Jul 6, 2010 3:43:37 PM org.apache.catalina.startup.Catali...

Get MIME Type via PHP

I have local access to files, which I need to get their MIME types. Working in WAMP/LAMP, CodeIgniter, and Zend libraries. What's the best way to get MIME type information? ...