Page view counter

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
    • Loading...
    • digeeshs
    • Joined on 11-20-2007, 12:47 AM
    • Posts 39
    • Points 23

    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
    • Loading...
    • DMW
    • Joined on 09-04-2002, 6:25 AM
    • Posts 1,993
    • Points 13,807
    • 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
    • Loading...
    • interwanderer1
    • Joined on 04-03-2005, 3:29 PM
    • Belgium
    • Posts 383
    • Points 1,890

    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 blog at www.Interdevelopments.com and check the future of open mobile widget solutions at www.glowe.org
  • Re: Get the external file url with respect to the server url

    12-28-2007, 8:22 AM
    Answer
    • Loading...
    • digeeshs
    • Joined on 11-20-2007, 12:47 AM
    • Posts 39
    • Points 23

    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)