Correct Apache AddType directives for font MIME types

I realize that this question is old, but for anyone looking for a quick copy/paste for adding font MIME types to their .htaccess: <IfModule mod_mime.c> AddType application/vnd.ms-fontobject .eot AddType application/x-font-opentype .otf AddType image/svg+xml .svg AddType application/x-font-ttf .ttf AddType application/font-woff .woff AddType application/font-woff2 .woff2 </IfModule>

Are there .NET Framework methods to parse an email (MIME)?

I know you said no external libraries, but I have a library posted on codeplex: https://bitbucket.org/otac0n/mailutilities MimeMessage msg = new MimeMessage(/* string, stream, or Byte[] */); It has been tested with over 40,000 real-world mail messages. I’m not too happy with my namespace choice, but… I’m too lazy to change it. PS: Internally, my library … Read more

How do I determine the extension(s) associated with a MIME type in PHP?

Not built-in, but it’s not terribly hard to roll your own: function system_extension_mime_types() { # Returns the system MIME type mapping of extensions to MIME types, as defined in /etc/mime.types. $out = array(); $file = fopen(‘/etc/mime.types’, ‘r’); while(($line = fgets($file)) !== false) { $line = trim(preg_replace(‘/#.*/’, ”, $line)); if(!$line) continue; $parts = preg_split(‘/\s+/’, $line); if(count($parts) … Read more

How do you get the icon, MIME type, and application associated with a file in the Linux Desktop?

Here is an example of using GLib/GIO to get the information you want. #include <gio/gio.h> #include <stdio.h> int main (int argc, char **argv) { g_thread_init (NULL); g_type_init (); if (argc < 2) return -1; GError *error; GFile *file = g_file_new_for_path (argv[1]); GFileInfo *file_info = g_file_query_info (file, “standard::*”, 0, NULL, &error); const char *content_type = g_file_info_get_content_type … Read more

How do I get File Type Information based on extension? (not MIME) in c#

Thanks Dan, Alright.. This answers the first question I had. Sadly not the second. Note: Not everything prints.. Credits to PInvoke.net using System; using System.Runtime.InteropServices; using System.Text; using System.Diagnostics; namespace WindowsFormsApplication1 { static class Program { [DllImport(“Shlwapi.dll”, SetLastError = true, CharSet = CharSet.Auto)] static extern uint AssocQueryString(AssocF flags, AssocStr str, string pszAssoc, string pszExtra, [Out] … Read more

Embedding attached images in HTML emails

Be more specific on how you build the HTML mail message. The result will be a multipart-MIME message with a text/html part (if you really do it right with an alternate part of type text/plain) and several images, which are then referenced from within the HTML. See RFC 1813 and RFC 2378 for more information … Read more