Monday, August 1, 2016

Associate custom mime type with a local application

When a file is downloaded in a browser, the browser asks whether to open the file directly (depending on browser settings). It is possible to define a custom mime type for our custom file extention (e.g. .xyz) and associate this custom mime type to a local exe program.

The steps have been listed below, though they might need some tweaks based on requirements.
[HKEY_CLASSES_ROOT\.atom]
    @="atom_file"

[HKEY_CLASSES_ROOT\atom_file]
    @="Atom Syndication Program"

[HKEY_CLASSES_ROOT\atom_file\shell]

[HKEY_CLASSES_ROOT\atom_file\shell\open]

[HKEY_CLASSES_ROOT\atom_file\shell\open\command]
    @="\"C:\\AtomHandler\\handle.exe\" %1"

[HKEY_CLASSES_ROOT\MIME\Database\Content Type\application/atom+xml]
    "Extension"=".atom"
This is copied from the stack overflow post

http://stackoverflow.com/questions/6267546/how-do-i-associate-a-custom-mime-type-to-my-local-application-in-the-major-brows

No comments:

c# httpclient The remote certificate is invalid according to the validation procedure: RemoteCertificateNameMismatch

 If we get this error while trying to get http reponse using HttpClient object, it could mean that certificate validation fails for the remo...