VirtualFiles File Management

What is the recommended way to have file and directory management with VirtualFiles using ASPNET Core?

The IVirtualFiles supports quite a few of the actions needed but we need more actions e.g. rename directory or file, copy file and directory etc

We could use a combination of the existing functions, e.g. rename file is a get existing -> write new copy -> delete existing but seems a bit inefficient or should we be using the ASPNET FileServer instead?


Don’t use VirtualFiles for anything it doesn’t support. If you need to manage the File System I’d be using the .NET File/Directory APIs directly, e.g. Directory.Move(), File.Move(), etc. I don’t know what ASP .NET File Server is.

Thanks for the quick response.

I was referring to the app builder IApplicationBuilder UseFileServer configuration and providers as an alternative to using VirtualFiles.

I’ll use the File / Directory.Move etc in combination with VirtualFiles.

1 Like