We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now


ASP.NET photo directory doesnt work

isaackhazi asked
Medium Priority
Last Modified: 2012-05-06
I recently setup a website that was online before. I set it up locally on intranet. Everything works except the photos dont display.
I have put the photos in the right directory.

I get this error in safari

Safari cant open D:/PRTR/prtrlive/uploadphoto/34978.jpg because the address does not start with a valid character.

						dim CandidatePhoto as string
						if File.Exists(Profile.UploadFolder & "photo\" & cnID & ".gif")  	
							CandidatePhoto = cnID & ".gif"
						end if
						if File.Exists(Profile.UploadFolder & "photo\" & cnID & ".jpg")
							CandidatePhoto = cnID & ".jpg"
						end if
						if CandidatePhoto <> "" then
						<a href="<%=Profile.UploadPath%>photo/<%=CandidatePhoto%>" target="_blank"><img src="<%=Profile.UploadPath%>photo/<%=CandidatePhoto%>" width="175" height="175" alt="Candidate Photo [<%=cnID%>]" border="0"></a>
						<img src="<%=Profile.AppPath%>_images/photoblank175-175.gif" width="175" height="175" alt="">
						<%end if%>
						<td align="center" style="font:bold 9px;"><b><i>click photo to view larger image...</i></b></td>

Open in new window

Watch Question

Anurag ThakurTechnical Manager
shoudnt the path be D:\PRTR\prtrlive\uploadphoto\34978.jpg instead of

i dont know how the path is being made but this seems like the reason

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
try adding "file://" before the path
I think, Profile.UploadPath is storing the path as local drive location.  If you access it from intranet, then the machine's, shared path may need to be given.  Else, create a virtual directory and map it to the web server and use the virtual path.


Had to chnage the web.config file Profile.UploadPath to
Changing it to local host works only on the local machine.

Thanx guys

Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.