Get the external file url with respect to the server url

Last post 12-28-2007 8:22 AM by digeeshs. 3 replies.

Sort Posts:

  • Get the external file url with respect to the server url

    12-28-2007, 4:14 AM
    • Member
      23 point Member
    • digeeshs
    • Member since 11-20-2007, 12:47 AM
    • Posts 39

    Hi,

    I have a file that is outside the server location. How can I get the url of the physical path of the external file?

    Thanks in advance.

  • Re: Get the external file url with respect to the server url

    12-28-2007, 8:08 AM
    • Star
      13,979 point Star
    • DMW
    • Member since 09-04-2002, 6:25 AM
    • Posts 2,006
    • Moderator

    A physical file that is outside the virtual directory folder has no accessible URL. If it did, then you'd be able to access all files on a web server.

    Regards

    Dave
  • Re: Get the external file url with respect to the server url

    12-28-2007, 8:20 AM
    • Participant
      1,917 point Participant
    • interwanderer1
    • Member since 04-03-2005, 3:29 PM
    • Belgium
    • Posts 395

    That's right... you can however get the url of that file if you know the name of the website...

    if you know that you're file is named     c:\inetpub\www\mywebsite\somefolder\thisisyourfile.txt  ... and your website is  www.yoursitename.com .... having the mywebsite as your website or virtual directory...

    then the location of your file thru url would be    www.yoursitename.com/somefolder/thisisyourfile.txt

    greets,

    Erdem

    see my latest project at www.SocialTomorrow.com.
  • Re: Get the external file url with respect to the server url

    12-28-2007, 8:22 AM
    Answer
    • Member
      23 point Member
    • digeeshs
    • Member since 11-20-2007, 12:47 AM
    • Posts 39

    mySrc = new Uri((@"D:\Data\Voice\2007\12\19\20071219105446001.wav"), UriKind.RelativeOrAbsolute).AbsoluteUri;

    this will give the url of the file.

Page 1 of 1 (4 items)