I've been working on an asp web application, which involves the user registering details of a person, including an image of the person. The file name of the details/image are stored in a SQL database with the image filename storied in an NVARCHAR
column, rather than storing the actual image in the DB.
I created a directory C:\Images to which the image files would be stored by the application. The application works correctly in as far as it moves the images to this location, but when I open the page which would display the details/image the image never renders.
I got round this during development by having the image stored in a folder which was part of the project, but after release of the project to the server, the application refuses to allow the image to be saved in any directories within C:\Inetpub\wwwroot\
.
So I need find out why the images won't render when they are stored in folders not within the project.
I've checked the source of the HTML page which also points to the correct location and file name:
img id="ctl00_MainContent_CandidateImage" src="C:\Images\applicant11.jpg" alt="Candidate Image" style="border-width:1px;border-style:solid;height:208px;width:208px;"
The code behind page renders the image in the code below:
// CandidatePhoto filename retrieved from DB.
CandidateImage.ImageUrl = "C:\\Images\\" + CandidatePhoto;
Does anyone have any ideas?
Cheers!