I have an Uploads folder in an App Service and uploading is successful.
However, when the app tries to delete the uploaded files, it encounters the error:
System.IO.IOException: Invalid access to memory location. : 'C:\home\site\wwwroot\wwwroot\sample\uploads\MyFile.txt'
I see the structure to be: myapp.scm.azurewebsites.net/dev/wwwroot/wwwroot/sample/uploads/MyFile.txt
private readonly string myUploadFolderPath = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", configuration["mySettings:UploadsFolderPath"]);public bool RemoveUploadedFiles() { if (Directory.Exists(myUploadFolderPath)) { string[] files = Directory.GetFiles(myUploadFolderPath); foreach (string file in files) { File.Delete(file); } return true; } return false;}