Last post Nov 15, 2017 08:37 AM by Edward Z
Nov 10, 2017 06:40 AM|paulharley421|LINK
Hi, I'm trying to make a web based file manager similar to webmin https://doxfer.webmin.com/Webmin/HTML_File_Manager, but I have no idea how to server other
files outside of project root folder. How can I make my whole drive (C:\, D:\ and other partition) to be view-able in web?
Nov 10, 2017 01:44 PM|Dmitry Sikorsky|LINK
It is not so difficult task. And you will be able to work with any file on your hard drives locally. On the server, your application's user must have access to the file system to be able to access that folders.
Nov 15, 2017 08:37 AM|Edward Z|LINK
>> but I have no idea how to server other files outside of project root folder.
For accessing physical files, you could try PhysicalFileProvider, and you could refer link below for more information.
A demo code like below:
var physicalProvider = new PhysicalFileProvider(@"E:\Edward"); //provide physical path
public class HomeController : Controller
private readonly ApplicationDbContext _context;
private readonly DbConnection _connection;
private readonly IFileProvider _fileProvider;
public HomeController(ApplicationDbContext context, DbConnection connection, IFileProvider fileProvider)
_context = context;
_connection = connection;
_fileProvider = fileProvider;
public IActionResult Contact()
var contents = _fileProvider.GetDirectoryContents("");
@foreach (IFileInfo item in Model)
<li>@item.Name - @item.Length bytes</li>