The Layer2 Cloud Connector can solve many issues with Office 365 out-of-the-box local file synchronization regarding the number of files allowed (>5.000, >20.000), file names and path length allowed, file types allowed and others. It also comes with flexible sync options to support subfolders in data source and destination, source filter options and more.
You can find a step-by-step intro to file synchronization with Office 365 on the vendor's web site.
File synchronization is just one option. It can sync data also SharePoint to SharePoint (e.g. for hybrid solutions)or with almost any other system or application, e.g. SQL databases, Exchange, Dynamics, ERP/CRM etc. The Layer2 Cloud Connector is a very cost effective solution with licensing per installation. There are several editions, from Personal to Professional. No user client access licenses (CALs) required.
You can download a free trial after registration on the vendor's web pages.