How to access the same set of images from 2 projects in asp.net -
vs 2013, sql server 2012, entity frame, web api 2
both project access same database
initially solution has 1 project. project read , write images. save image path in database , save image in project's folder "~/images/".
later added project solution. project need read , write same set of images. when try read image saved first project (say "~/images/xyz.jpg") first getting image path database , access it, told file doesn't exist. realize concatenating first project's domain name , path "~/images/xyz.jpg". "~/images/xyz.jpg" path in project 1. apparently doesn't exist, don't have "~/images" folder in second project.
i going deploy these 2 projects azure. not going configure iis.
how can solve problem? thank you.
i suggest use absolute path getting images. can introduce config parameter image path (put in in web.config) - example c:\myprojectname\images. save image filename database. when retrieving image filename back, concatenate absolute path config , able access it.
one things. make sure check , create folder if not exist on app start.
Comments
Post a Comment