mime

How Do I Set MIME Type Of A Local File?

I want to be able to set the MIME type of a JavaScript file so that when the file is opened in an internet browser, it is automatically executed. How would I go about doing this? Thank you in advance for your help ...

In Rails 3, respond_to and format.all works differently than Rails 2?

the code respond_to do |format| format.html format.json { render :json => @switches } format.xml { render :xml => @switches.to_xml } format.all { render :text => "only HTML, XML, and JSON format are supported at the moment." } end the above will work in Rails 2.2.2. But in Rails 3, getting controller/index.html or index on th...

Set up MIME::Lite on Windows 7 without Outlook

Hi, I run ActiveState's ActivePerl on my Windows 7 box. I just installed the MIME::Lite module using the PPM (Perl Package Manager). The installation went fine. However, as I try to run a very simple script use strict; use MIME::Lite; my $msg = MIME::Lite->new( From => '[email protected]', To => '[email protected]...

How can I get the mime type in PHP

I am writing a script and I need to correctly (I think some mime types can be different from their extensions) get the mime types of files (the files can be of any type). Web hosting company in use does not have mime_content_type() and is still (don't know which year they will be fixing it) promising to fix the PECL alternative. Which ...

Nginx offers of downoload SVG instead of showing it

I try to show SVG file in HTML or separate tab but Nginx offers me to download it. I took normal SVG file which works on another site but not in my server. Where is a problem? There is an example http://proximax.ru/media/content/final/plane2.svg Also here SVG in HTML http://proximax.ru/index/ ...

How can I send a multi-part email with text/plain and text/html parts with Grails?

I've looked through the code and documentation for the Grails Mail plugin (version 0.9) and it doesn't have the support I'm looking for. You can only set a single body and then provide a mime attachment that points to a static file. I need to actual pass a model into a GSP and have it render both the HTML and plain text versions and the...

Why does Perl's MIME::Lite fail with " SMTP data() command failed: 2.1.5 ... Recipient ok"?

This is probably a crossover question that is valid for both SO and SF. I am using a Perl script as follows to send e-mail: my $SMTP_SERVER = 'xx.xx.xx.xx'; my $DEFAULT_SENDER = '[email protected]'; my $DEFAULT_RECIPIENT = '[email protected]'; ### Create the multipart "container": $msg = MIME::Lite->new( From =>$DEFAULT_SENDER, T...

MIME issues with IE6

I'm developing a web service that will allow my clients to download files of any type that are stored as binary data. Firefox 3.6.9 successfully prompts the user with the download dialog. However, my clients will be using IE6, which simply prints the binary data on the screen instead of prompting the user to download. Is IE6 ignoring m...

How do I detect plaintext in a MIME file?

I have a large set of MIME files, which contain multiple parts. Many of the files contain parts labelled with the following headers: Content-Type: application/octet stream Content-Transfer-Encoding: Binary However, sometimes the contents of these parts are some form of binary code, and sometimes they are plaintext. Is there a clev...

Detecting a file mimetype in coldfusion that's already uploaded on the server

I am attempting to detect the file type of a library of files on our webserver as we are implementing code that is designed to stream files to the browser securely. Previously, the files were being stored and presented to users via a direct href. I have attempted to do this 3 different ways, all on my local machine (which is NOT a simu...

Possibility of detecting language of email body by Email headers

Hi, Adding on one more query extending from here Detecting language of email body: Since I want to determine the language of the email that I receive on my system, so that I can reply to the sender in same language. So in the email headers there is one header of the kind: 'Content-Type: text/plain; charset=ISO-8859-1' How good it ca...

MIME "From:" header with national characters

What is the correct format of "From:" header when From Name contains national characters and dot (.) character? We generate (using C# Chilkat lib) this: From: =?utf-8?Q?Micha=C5=82_from_domain.com?= <[email protected]> (where From Name = Michał from domain.com) This works OK in most cases. However, we encountered an email provider w...

Using PHP mail - setting correct MIME type

I've got a problem with a PHP script which sends an email confirmation. When receiving the email in Thunderbird, the header comes through with the \r\n present and with the MIME type also containing the Content-type information. Hence the email renders as plain text, rather than HTML. If I comment out the MIME type as below, the email r...

How do I get curl to correctly identify mime type?

I'm using php to post an image along with some other data. Using the sample code from the php doc site (example 2 here: http://php.net/manual/en/function.curl-setopt.php, if I output what gets sent with my script ($_FILE) I see something like this: Array ( [file] => Array ( [name] => temp.gif [type] => application/o...

How to get the MIME type of a file in Qt?

Is there a way to get the MIME type of a file in Qt? I am writing an application that needs to find the MIME type of a given file. ...

Character corruption for Chinese (simple and traditional) and Korean texts

Hi, I have a setup, where emails received by mail server(postfix) are taken on and the resulting email's body(html or plain text) and attachments are parsed to separate files and saved, for this i use javax mail api. The problem occurs for email body when it is in Chinese (simple and traditional) (charset GB2312, as per email header) o...

Basic C# Mime Decoding

Is there a clean way of handling multi-part MIME data in C#. After a call to a closed application (I have no access to change it) I get a MIME reponse like the one below. Does C# provide the ability to parse this via System.Net.Mime or System.Net.Mail? MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_42_31322...

[Python] Extract content from a file with mime multipart

Hi, I have a file that contain a tiff image and a document xml in a multipart mime document. I would extract the image from this file. How I can get it? I have this code, but it requires an infinite time to extract it, if I have a big file (for example 30Mb), so this is unuseful. f=open("content_file.txt","rb") msg = email.message_fr...

Mime, Atom feed or IMapx for reading from gmail

Hi, I am little confused as to what is the best approach for reading mails from gmail Here are the links that I reffered: http://hellowebapps.com/products/imapx/ http://stackoverflow.com/questions/1530724/imap-on-c-download-mails-and-attachments http://stackoverflow.com/questions/989986/reading-atom-feed-of-gmail-account-from-c I ha...

How to pull html encoding from email data using PHP

I'm working with emails and want to display the html in the browser, I'm not sure how to deal with the encoding. I want to extract the html to display it in the html browser. The way I plan on doing this is using an html parser on the entire email parsing the data inbetween the tags in the html section. Is there an easier/more effici...