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

Discussion in 'ASP .Net Security' started by Filip De Backer, Jan 27, 2005.

  1. 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
    Filip De Backer, Jan 27, 2005
    #1
    1. Advertising

  2. Filip De Backer

    Ken Schaefer Guest

    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

    "Filip De Backer" <.(donotspam)> wrote in message
    news:...
    > 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
    >
    Ken Schaefer, Jan 27, 2005
    #2
    1. Advertising

  3. Filip De Backer

    Ken Schaefer Guest

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

    Cheers
    Ken

    "Ken Schaefer" <> wrote in message
    news:...
    > 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
    >
    > "Filip De Backer" <.(donotspam)> wrote in
    > message news:...
    >> 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
    >>

    >
    >
    Ken Schaefer, Jan 27, 2005
    #3
  4. 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


    "Ken Schaefer" wrote:

    > 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
    >
    > "Filip De Backer" <.(donotspam)> wrote in message
    > news:...
    > > 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
    > >

    >
    >
    >
    Filip De Backer, Jan 27, 2005
    #4
  5. Filip De Backer

    Ken Schaefer Guest

    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

    "Filip De Backer" <.(donotspam)> wrote in message
    news:...
    > 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
    >
    >
    > "Ken Schaefer" wrote:
    >
    >> 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
    >>
    >> "Filip De Backer" <.(donotspam)> wrote in
    >> message
    >> news:...
    >> > 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
    >> >

    >>
    >>
    >>
    Ken Schaefer, Jan 27, 2005
    #5
  6. 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.


    "Ken Schaefer" wrote:

    > 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
    >
    > "Filip De Backer" <.(donotspam)> wrote in message
    > news:...
    > > 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
    > >
    > >
    > > "Ken Schaefer" wrote:
    > >
    > >> 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
    > >>
    > >> "Filip De Backer" <.(donotspam)> wrote in
    > >> message
    > >> news:...
    > >> > 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
    > >> >
    > >>
    > >>
    > >>

    >
    >
    >
    Filip De Backer, Jan 27, 2005
    #6
  7. Filip De Backer

    Ken Schaefer Guest

    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


    "Filip De Backer" <.(donotspam)> wrote in message
    news:...
    > 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.
    >
    >
    > "Ken Schaefer" wrote:
    >
    >> 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
    >>
    >> "Filip De Backer" <.(donotspam)> wrote in
    >> message
    >> news:...
    >> > 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
    >> >
    >> >
    >> > "Ken Schaefer" wrote:
    >> >
    >> >> 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
    >> >>
    >> >> "Filip De Backer" <.(donotspam)> wrote in
    >> >> message
    >> >> news:...
    >> >> > 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
    >> >> >
    >> >>
    >> >>
    >> >>

    >>
    >>
    >>
    Ken Schaefer, Jan 28, 2005
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. CT
    Replies:
    0
    Views:
    446
  2. CodeMeister
    Replies:
    0
    Views:
    481
    CodeMeister
    May 15, 2004
  3. Mike John
    Replies:
    0
    Views:
    506
    Mike John
    Jul 28, 2003
  4. Alexander Malkis
    Replies:
    10
    Views:
    900
  5. Ephrem
    Replies:
    3
    Views:
    118
    Ephrem Beyene
    Aug 10, 2003
Loading...

Share This Page