[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 201
  • Last Modified:

ASP.NET photo directory doesnt work

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>
						<%else%>
						<img src="<%=Profile.AppPath%>_images/photoblank175-175.gif" width="175" height="175" alt="">
						<%end if%>
						</td>
					</tr>
					<tr>
						<td align="center" style="font:bold 9px;"><b><i>click photo to view larger image...</i></b></td>

Open in new window

0
isaackhazi
Asked:
isaackhazi
3 Solutions
 
Anurag ThakurCommented:
shoudnt the path be D:\PRTR\prtrlive\uploadphoto\34978.jpg instead of
D:/PRTR/prtrlive/uploadphoto/34978.jpg

i dont know how the path is being made but this seems like the reason
0
 
SunnyDarkCommented:
try adding "file://" before the path
0
 
CB_ThirumalaiCommented:
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.
0
 
isaackhaziAuthor Commented:
Had to chnage the web.config file Profile.UploadPath to http://192.168.0.51/public/upload
Changing it to local host works only on the local machine.

Thanx guys

0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now