Within my application I have multiple file locations that hold different types of images. I'm wondering how I should handle these locations within my MVC application?
I want to achieve the following:
- Make the image locations easily reusable within my MVC application (within views to display and within controllers for image uploads)
- Make the linking/uploading to the image locations less error-prone
- Store the locations some how within the application
For example I have the following places within the file system:
- ~/Content/Images/ImageType1
- ~/Content/Images/ImageType2
- ~/Content/Images/ImageType3
- ~/Content/Images/ImageType4
These are the following options that I've found so far:
Just link to the images within the tags (error-prone)
eg. <img src="~/Content/Images/ImageType4/{imagefilename}">
Helper method to display each type of image
- Creating a route for each image location?
Are there any other ways that I haven't thought of?