Azure App Service - write to filesystem - ASP.NET web application

后端 未结 2 1957
渐次进展
渐次进展 2021-01-21 10:12

I have an ASP.NET web application, created in Visual Studio 2017.

In the application there is a form, where the users can upload files. When files are uploaded, I proces

2条回答
  •  萌比男神i
    2021-01-21 10:30

    You should never use absolute paths on server components. Try something like this for instance

    var folder = Environment.GetFolderPath(System.Environment.SpecialFolder.CommonApplicationData);
    var filePath = Path.Combine(folder, Request.Files["file"]);
    

提交回复
热议问题