When ASP.NET Core was released back in June 2016, we could not find a file manager for the TinyMCE web editing tool which we use in all our Content Management Systems (even as of January 2018 we cannot find one). We normally use the excellent Roxy Fileman file manager which supports ASP.NET but not ASP.NET Core. This was a big stumbling block for us, and probably many other developers wishing to use ASP.NET Core, as the majority of web applications these days will require integrated content management, and TinyMCE is one of the best tools at our disposal.
After examining the Roxy Fileman code we realised it would be reasonably straightforward to recode the ASP.NET code they provide into ASP.NET Core, maintaining the vast majority of functionality. We are providing this code here to other developers in the hope that it saves you the need to do the same thing. We must note that as ASP.NET Core does not yet provide a release version of the System.Drawing library we have not implemented any code that processes images, such as resizing, thumbnail generation or image dimension extraction.
Downloading Roxy Fileman for .NET reveals that the folder structure contain an HTTP Handler in a file named main.ashx within the asp_net folder. File manager calls to this handler are defined in the conf.json file; by amending these two files we were able to implement a .NET Core version as our own API (essentially a REST web service accessible to "Authorized" users via the URL /api/RoxyFileman/[Action]). We stuck to the original structure of the code from Roxy as much as possible.
We have created a stripped-back ASP.NET Core project showing how to implement RoxyFileman as a standalone page; please download this before proceeding. The process is quite straightforward:
app.UseSession();to your Configure method.
[Authorize]attribute on the RoxyFilemanController class (we have commented this only for demo simplicity) to ensure that only logged-in users can access this class (otherwise anybody who discovers the API/RoxyFileman URL will be able to upload files to your site - a huge security risk).
Please see the installation instructions on the Roxy Fileman site for implementing with TinyMCE or CKeditor.