I´m working on an application that uploads some images, then show them.
The images are store in a structure similar to this:
\App_Data\files\0d10e5c1-13ad-4493-97e7-dc4b09dc15e1\2012\3\4
As you can see, the files are segmented by companyID (the Guid), year, month and day.
The problem is when I want to show the image, I get an error “access to the path is denied” The funny thing is that the images can upload without any problems. I tried whatever combination of permission you can imagine on the folders and still nothing.
This is driving me crazy! Any ideas?
A little extra info:
The App is ASP.NET MVC 3 Project and the IIS is 7.5
I’m showing the image using a controller like this:
[HttpGet]
public ActionResult show(Guid id)
{
var results = productImagesRepository.showProductImage(id);
return File(results.imageNameAndPath, results.contentType);
}
Researching, I found this:
So I tried creating a new forlder outside the APP_DATA but the results are the same.