

In programming languages, a handler is something that has to be handled by writing explicit custom code.
Take, for example, event handlers in SharePoint for various events like when the Item is added, updated or deleted. Whenever these events occur, if we want to customize the default behavior of the system, we write a handler for that event in our custom logic.
The file handler can be displayed as a message when deleting an item or may be pre-checking the state of the system before a deletion or even just a simple logging when a particular item is deleted from the list.
When we try to open any Microsoft files such as Word or PowerPoint, Office 365 knows how to deal with those files. For instance, it opens Word files in Word Online for previewing files and even editing them, so you can work with the file while inside the browser. But what if you want custom behavior for non-Microsoft file types? This is where Office 365 file handlers come into the picture.
Microsoft has provided a way of implementing file handlers in Office 365 to deal with non-Microsoft file types.
You can customize any existing file type or even entirely new file types which is proprietary of any organization. With file handlers we can customize the following behaviors for unknown file types:
Office 365 knows how to deal with Microsoft office file types. It shows the relevant icon for the file and will even read the file content for metadata properties as well as previewing the file when we look for properties. But for non-Microsoft Office file types or unknown file types, Office 365 will not automatically know how to read the file. That’s where file handlers come to the rescue.
To create a file handler add-in for Office 365, we have to take the following steps:
You can find these methods in the FileHandlerController.cs file in the Controllers folder of the project solution.
For the Preview method, look for the following method declaration: public async Task Preview(). This method will be called when the file has to be previewed from the SharePoint library.
For the Open method, look for the following method declaration: public async Task Open(). This method will be called when the file has to be opened and to allow users to view or edit the file.
File handlers help Office 365 deal with unknown file types rather than lying in the repository as an unknown file type. They allow users to interact more dynamically with the files rather than simply downloading them to the system and then viewing them. File handlers also allow users to have different experiences with different type of files.
Are you using any specific Office 365 file handlers for your organization? Let us know in the comments.
If you haven't tried our popular SharePoint migration tool yet, what are you waiting for? ShareGate Desktop's UI isn't just simple and intuitive—it'S actually pleasant to use (really!).
Migrate to SharePoint or Office 365 quickly and easily, with best-in-class migration for all versions of SharePoint, unlimited data, and custom reporting. And effortlessly reorganize and restructure your content until it's exactly how you want it.
Save time and migrate with total peace of mind, then get back to business as usual. See for yourself with a free, full-featured 15-day trial.