Image doesn't load and security on folder is the cause??

F

Filip De Backer

hi everyone,

On the webserver, all the websites are in folders on the d-drive.
eg: my test website is 'd:\dir1\dir2\websites\asptest'.
The IIS is configurated that all th esite sare in the d:\...\websites\
directory

I want to show a picture in the Image control.
The images are in 'd:\dir1\dir2\websites\asptest\pictures'.

when I said ImageUrl= "/asptest/pictures/picture1.jpg, it doesn't work.
All the domain users and the asp .net machine user have full control to this
folder, and still it doesn't work.

But when I've created a share for thedirectory, it works fine.
so ImageUrl="\\servername\sharename$\pictures\picture1.jpg" works fine.

How does this come?

thanks for the answers,

Filip
 
K

Ken Schaefer

Please do a "view source" in your browser, and post the relevant HTML that
isn't working. You are looking for an

<img src="...." >

tag. Does the src= attribute appear to contain a valid URL?

Cheers
Ken
 
K

Ken Schaefer

Additionally, check your IIS logfiles to determine why the file is not being
sent to the client.

Cheers
Ken
 
F

Filip De Backer

if (File.Exists(strPicturePath))
{
strHtml = strHtml + "<img src='" + strPicturePath + "'>";
}

So there isn't any img tag in my html page, but when use the share on the
directory it works
 
K

Ken Schaefer

There must be an <img> tag in your HTML source. Your web-browser only
understands HTML.

Don't look in your code source. You need to look in your *HTML* source (in
your web-browser).

Cheers
Ken
 
F

Filip De Backer

I've checked the source in the webbrowser, so that's why I've posted that
piece of code.... I relly don't know what the difference is between the two
pethods of getting the picture.
 
K

Ken Schaefer

If you are using Internet Explorer, use View -> Source.

Notepad should open, and you should see the HTML source sent from the
webserver to the browser. Check the <img> tag to see what it looks like.
Post that here.

Cheers
Ken
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top