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

Popular posts from this blog

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -