Click to See Complete Forum and Search --> : including and image out side of the wwwroot folder


pelegk1
10-07-2006, 04:19 PM
can i add an image to a page where the image is outside of the wwroot folder?
if yes then how?
thnaks in advance
peleg

chrismartz
10-07-2006, 05:23 PM
Could you give a directory example?

pelegk1
10-08-2006, 02:43 AM
say i have an image called 1.jpg
and the web folder on iis is : c:\inetput\wwwroot
and i put the image on c:\inetpub\1.jpg
i can put this in an image tag like this : <img src="../1.jpg">
what can i do?

bathurst_guy
10-08-2006, 02:47 AM
No the image must be accessable from the web, therefore in the root folder or below.

jvanamali
10-08-2006, 03:59 AM
if you have to definetely include an image that is not in wwwroot, the create a virtual directory for images and give the full path (i.e) suppose you created a virtual directory vimages which has the images then <image src="http://servername/vimages/myomg.jpg">

pelegk1
10-16-2006, 07:23 AM
can a user access this new virtual folder from outside?

etylocus
10-19-2006, 05:04 AM
You can access any file outside the wwwroot folder, as long as the user used by IIS has at least read rights to the file, but then you have to "interface" that file with an asp file within the wwroot folder (or any virtual folder).
I think it's going to be easier for you to create a virtual folder (http://support.microsoft.com/?scid=kb%3Ben-us%3B301392&x=10&y=12) than interfacing the file. If you still want to give it a go, search information about response.contentType and response.binaryWrite. there's an example (http://www.chestysoft.com/imagefile/thumbdir.zip) in this page (http://www.chestysoft.com/imagefile/resizecode.asp), but it uses a control that you have to install in your server to be able to use it.