Microsoft Office 2007 file type, Mime types and identifying characters

Office 2007 MIME Types for IIS .docm, application/vnd.ms-word.document.macroEnabled.12 .docx, application/vnd.openxmlformats-officedocument.wordprocessingml.document .dotm, application/vnd.ms-word.template.macroEnabled.12 .dotx, application/vnd.openxmlformats-officedocument.wordprocessingml.template .potm, application/vnd.ms-powerpoint.template.macroEnabled.12 .potx, application/vnd.openxmlformats-officedocument.presentationml.template .ppam, application/vnd.ms-powerpoint.addin.macroEnabled.12 .ppsm, application/vnd.ms-powerpoint.slideshow.macroEnabled.12 .ppsx, application/vnd.openxmlformats-officedocument.presentationml.slideshow .pptm, application/vnd.ms-powerpoint.presentation.macroEnabled.12 .pptx, application/vnd.openxmlformats-officedocument.presentationml.presentation .xlam, application/vnd.ms-excel.addin.macroEnabled.12 .xlsb, application/vnd.ms-excel.sheet.binary.macroEnabled.12 .xlsm, application/vnd.ms-excel.sheet.macroEnabled.12 .xlsx, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet .xltm, application/vnd.ms-excel.template.macroEnabled.12 .xltx, application/vnd.openxmlformats-officedocument.spreadsheetml.template

difference between text file and binary file

At the bottom level, they are all bits… true. However, some transmission channels have seven bits per byte, and other transmission channels have eight bits per byte. If you transmit ASCII text over a seven-bit channel, then all is fine. Binary data gets mangled. Additionally, different systems use different conventions for line endings: LF and … Read more

Register file extensions / mime types in Linux

Use xdg-utils from freedesktop.org Portland. Register the icon for the MIME type: xdg-icon-resource install –context mimetypes –size 48 myicon-file-type.png x-application-mytype Create a configuration file (freedesktop Shared MIME documentation): <?xml version=”1.0″?> <mime-info xmlns=”http://www.freedesktop.org/standards/shared-mime-info”> <mime-type type=”application/x-mytype”> <comment>A witty comment</comment> <comment xml:lang=”it”>Uno Commento</comment> <glob pattern=”*.myapp”/> </mime-type> </mime-info> Install the configuration file: xdg-mime install mytype-mime.xml This gets your files … Read more

Finding the default application for opening a particular file type on Windows

All current answers are unreliable. The registry is an implementation detail and indeed such code is broken on my Windows 8.1 machine. The proper way to do this is using the Win32 API, specifically AssocQueryString: using System.Runtime.InteropServices; [DllImport(“Shlwapi.dll”, CharSet = CharSet.Unicode)] public static extern uint AssocQueryString( AssocF flags, AssocStr str, string pszAssoc, string pszExtra, [Out] … Read more

What do .c and .h file extensions mean to C?

.c : c file (where the real action is, in general) .h : header file (to be included with a preprocessor #include directive). Contains stuff that is normally deemed to be shared with other parts of your code, like function prototypes, #define’d stuff, extern declaration for global variables (oh, the horror) and the like. Technically, … Read more

Determine file type in Ruby

There is a ruby binding to libmagic that does what you need. It is available as a gem named ruby-filemagic: gem install ruby-filemagic Require libmagic-dev. The documentation seems a little thin, but this should get you started: $ irb irb(main):001:0> require ‘filemagic’ => true irb(main):002:0> fm = FileMagic.new => #<FileMagic:0x7fd4afb0> irb(main):003:0> fm.file(‘foo.zip’) => “Zip archive … Read more

Webstorm not recognising JavaScript file

So I see three possible reasons for the problem: The file was marked as ‘Plain text’ There is a pattern for ‘Text files’ file type that matches this file (or back: file type ‘JavaScript’ exclude this file name). See image below There is a custom plugin that overrides default behavior for files with this name … Read more