ASP.NET MVC – Routing – an action with file extension

You need to map requests for your XML files to TransferRequestHandler in web.config. Otherwise IIS will handle the request. Jon Galloway explains how to do this here. In summary, you add this element to location/system.webServer/handlers in your web.config: <add name=”XmlFileHandler” path=”*.xml” verb=”GET” type=”System.Web.Handlers.TransferRequestHandler” preCondition=”integratedMode,runtimeVersionv4.0″ />

How to get only images using scandir in PHP?

You can use glob $images = glob(‘/tmp/*.{jpeg,gif,png}’, GLOB_BRACE); If you need this to be case-insensitive, you could use a DirectoryIterator in combination with a RegexIterator or pass the result of scandir to array_map and use a callback that filters any unwanted extensions. Whether you use strpos, fnmatch or pathinfo to get the extension is up … Read more

Where does Windows store its “Open With” settings?

Take a look in: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\ and the sub-key of that is the extension you reassigned. Under that there will be the UserChoice and OpenWithList sub-keys which will contain your redefinition. You may also want to read http://support.microsoft.com/kb/950505 which talks about your issue. Update As of Windows 8, life has gotten far more complicated. To create … Read more