Picture and absolute path

Last post 07-15-2005 7:19 PM by Xanderno. 10 replies.

Sort Posts:

  • Picture and absolute path

    07-14-2005, 6:19 AM
    • Member
      205 point Member
    • testvoid
    • Member since 05-13-2005, 10:57 AM
    • Posts 41
    I have a bunch of websites that use the same pictures. I want all there websites to draw from the same foler which will make the administration of the pictures easier. All the sites are hosted on the same server.

    How do I get the pictures for all sites from this one folder?
    If I use the absolute path: file:///C:/website/files/2011/logos/2018.gif is just displays nothing and if I use this path it shows a broken link:
    C:/website/files/2011/logos/2018.gif

    I have checked the spelling and everything is 100%
    If I copy the file that is requesting these pictures outside of the applications root it gets the file fine.
    This is a asp.net application.

    So my question again. How do I get the pictures for all sites from this one folder?
  • Re: Picture and absolute path

    07-14-2005, 7:47 AM
    • Participant
      1,275 point Participant
    • brianparker
    • Member since 01-08-2005, 9:05 AM
    • Taylors, SC
    • Posts 255

    It may be a security issue involving user rights. The easy and safe way to accomplish what you want is to choose a web site as the host for the picture and put your image in the Images folder. Then reference regularly from that website. The other web sites can get the picture by useing the website path such as http://www.yoursite.com/images/yourpic.jpg . This is how most people recycle images.

    I hope that this helps you.


    It's not a bug, it's a feature.



    Brian Parker
    CEO, Cofounder
    NeoTekSystems
    Phone:(864)770-0473
    Fax:(864)770-0476
    www.neoteksystems.com
    bparker@neoteksystems.com
  • Re: Picture and absolute path

    07-14-2005, 8:16 AM
    • All-Star
      98,232 point All-Star
    • mbanavige
    • Member since 11-06-2003, 1:29 PM
    • New England, USA
    • Posts 10,355
    • Moderator
      TrustedFriends-MVPs

    add a virutal folder to all you apps that point to the same images folder.
    reference the images from the virtual folder

    Mike Banavige
    ~~~~~~~~~~~~
    Need a site code sample in a different language? Try converting it with: http://converter.telerik.com/
  • Re: Picture and absolute path

    07-15-2005, 2:29 AM
    • Member
      205 point Member
    • testvoid
    • Member since 05-13-2005, 10:57 AM
    • Posts 41
     brianparker wrote:

     The other web sites can get the picture by useing the website path such as http://www.yoursite.com/images/yourpic.jpg . This is how most people recycle images.

    I hope that this helps you.



    I just want to ask one question in doing it this way. Is it not slower to access the pictures this way? If it is slower is it much slower or only a little slower?
  • Re: Picture and absolute path

    07-15-2005, 8:26 AM
    • Participant
      1,275 point Participant
    • brianparker
    • Member since 01-08-2005, 9:05 AM
    • Taylors, SC
    • Posts 255
    You should not notice a difference.

    It's not a bug, it's a feature.



    Brian Parker
    CEO, Cofounder
    NeoTekSystems
    Phone:(864)770-0473
    Fax:(864)770-0476
    www.neoteksystems.com
    bparker@neoteksystems.com
  • Re: Picture and absolute path

    07-15-2005, 10:30 AM
    • Member
      205 point Member
    • testvoid
    • Member since 05-13-2005, 10:57 AM
    • Posts 41
    Thanks a lot. I wanted to do it that way at first but thought it would make a speed difference.
  • Re: Picture and absolute path

    07-15-2005, 5:32 PM
    • All-Star
      23,606 point All-Star
    • azamsharp
    • Member since 06-11-2003, 9:36 AM
    • Houston,Texas
    • Posts 4,519
    • TrustedFriends-MVPs
    If you are concerned about speed than take a look at Output caching. You can cache your images so the new user will see the images returned to him from the cache.
    HighOnCoding
    Get high on ASP.NET articles, videos, podcasts and more!
  • Re: Picture and absolute path

    07-15-2005, 5:40 PM
    • Contributor
      5,962 point Contributor
    • Xanderno
    • Member since 06-17-2002, 11:24 AM
    • Plano, TX
    • Posts 1,181
     testvoid wrote:
    Thanks a lot. I wanted to do it that way at first but thought it would make a speed difference.


    No, as Brian mentioned, you won't notice a speed difference, because it's not slower at all.  It'll be exactly the same as if you were using a relative path to the same directory.  There's no need to do anything special at all.
  • Re: Picture and absolute path

    07-15-2005, 5:42 PM
    • Contributor
      5,962 point Contributor
    • Xanderno
    • Member since 06-17-2002, 11:24 AM
    • Plano, TX
    • Posts 1,181
     azamsharp wrote:
    If you are concerned about speed than take a look at Output caching. You can cache your images so the new user will see the images returned to him from the cache.


    That's not how output caching works.  Output caching caches compiled ASP.Net pages, *not* images, which are retrieved via seperate HTTP requests that the browser is making after it's gotten the page. 
  • Re: Picture and absolute path

    07-15-2005, 5:51 PM
    • All-Star
      23,606 point All-Star
    • azamsharp
    • Member since 06-11-2003, 9:36 AM
    • Houston,Texas
    • Posts 4,519
    • TrustedFriends-MVPs
    Thanks for correcting me. However you can cache the images using your webserver.

    For that check out this post: http://forums.asp.net/971043/ShowPost.aspx



    HighOnCoding
    Get high on ASP.NET articles, videos, podcasts and more!
  • Re: Picture and absolute path

    07-15-2005, 7:19 PM
    • Contributor
      5,962 point Contributor
    • Xanderno
    • Member since 06-17-2002, 11:24 AM
    • Plano, TX
    • Posts 1,181
     azamsharp wrote:
    Thanks for correcting me. However you can cache the images using your webserver.

    For that check out this post: http://forums.asp.net/971043/ShowPost.aspx





    True, but note that that's really most relevant for images that are changing.  Images that don't change are going to be cached on the client by default, anyway, and the browser is intially only going to request the status from the server on subsequent loads...The server should return a 304 not modifed, and the image will be loaded out of the browser's cache.  Regardless,  caching or not won't effect the handling of relative vs. fully-qualifed URLs (the original question) at all. 
Page 1 of 1 (11 items)