I am developing ASP.NET MVC applications with MS Visual Studio 2008 SP1.
My default project structure:
Project | -Content | -css | -img | -Models | -Views | -Controllers
The fact is that I can access all the content placed in the Content directory, provided that the file included in the project. On the other hand, if I have an image (IE image uploaded by the user) that is on the right physical directory (Project \ Content \ img), but not included in the project, I continue to get 404 when accessing them in the browser.
I believe my URL is correct:
http: // localhost: 1260 / Content / img / my_image.jpg
And I have a file in Project \ Content \ img \ my_image.jpg.
What could be wrong? Am I forced to include all files in a project? I don’t think so, because it will mean that I cannot upload and save images by web users in this way.
Many thanks.
source
share