I am working on an asp web application that includes a user logging in about a person, including a personβs image. The part / image file name is stored in the SQL database with the image file name stored in the column NVARCHAR, instead of storing the actual image in the database.
I created the C: \ Images directory in which image files will be stored by the application. The application works correctly because it moves images to this place, but when I open the page on which the details / image will be displayed, the image is never displayed.
I circumvented this during development, having the image stored in a folder that was part of the project, but after the project went to the server, the application refuses to allow the image to be saved in any directories in C:\Inetpub\wwwroot\.
Therefore, I need to find out why the images will not be displayed when they are stored in folders that are not part of the project.
I 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;"
Code by page displays the image in code below:
// CandidatePhoto filename retrieved from DB.
CandidateImage.ImageUrl = "C:\\Images\\" + CandidatePhoto;
Does anyone have any ideas?
Hooray!
source
share