I am trying to run an ASP5/MVC6 ASPNET core application in Ubuntu 16.04 using dotnet core 1.1. My application resides in one directory off of the users home directory, and another directory off the home directory holds a folder structure with image (.jpg) files.
I am receiving the following error...
fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[0]
An unhandled exception has occurred: Access to the path '/home/myuser/myimages/somefolder' is denied.
System.UnauthorizedAccessException: Access to the path '/home/myuser/myimages/somefolder' is denied. ---> System.IO.IOException: Permission denied
Here is an example of the folder structure...
/home/myuser/mywebapp/mywebapp.dll
/home/myuser/myimages/somefolder/someimage.jpg
I Have chmodded the following directories to 777..
- /home
- /home/myuser
- /home/myuser/myimages
- /home/myuser/myimages/somefolder
... and I have chmodded file someimage.jpg to 777 as well.
I am running the aspnet core application from /home/myuser/mywebapp. I have tried sudo and no good.
Can I reference files in ASPNET Core web app that are in a directory outside of the working directory?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…