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
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"]);
Use %TEMP%
, which on Azure App Service (Windows) resolves to d:\local
. That's the local machine disk, not network storage, so significantly faster. It gets wiped on app restart so code accordingly.
var tempDirectoryPath = Environment.GetEnvironmentVariable("TEMP");
var filePath = Path.Combine(tempDirectoryPath, Request.Files["file"]);
If you want durability use Blob Storage instead.