With the asp.net core , I can upload a file to the wwwroot path , but how can I upload file to the path out of wwwroot , e.g. “D:/MyPath”,
My code, like this :
var filePath = @"D:\mydata";
using (Stream outputStream = new FileStream(filePath, fileMode)){//do sth}
when I run it , I get the error as :
UnauthorizedAccessException: Access to the path 'D:\mydata' is denied.
System.IO.FileStream.OpenHandle(FileMode mode, FileShare share, FileOptions options)