Geting the path to a directory

Results 1 to 3 of 3

Thread: Geting the path to a directory

  1. #1
    Join Date
    Dec 1969

    Default Geting the path to a directory

    Hello,<BR><BR>I&#039;m sure this has been asked before, and yes, I did check the FAQ...<BR><BR>What I need is to get the physical path for the directory that contains the current asp file. I don&#039;t want the path WITH the file name, just the path UP TO the directory. I know that I can use the PATH_TRANSLATED server variable and hack the file name out, but is there an easier/better way???<BR><BR>Thanks in advance!

  2. #2
    Join Date
    Dec 1969

    Default RE: try this...

    &#060;%<BR>Function FileName()<BR> Dim temp<BR> temp = Split(Request.ServerVariables("URL"),"/")<BR> FileName = temp(UBound(temp))<BR>End function<BR>%&#062;<BR><BR><BR><BR>It will grab the file name.

  3. #3
    Join Date
    Dec 1969

    Default He wants the opposite...

    ...everything *except* the file name.<BR>&#060;%<BR>filename = .... &#039; full path with file name<BR>dirOnly = Left( filename, InStrRev( filename, "\" ) - 1 )<BR>%&#062;<BR>Change to / depending on what you are getting, of course.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts