Getting File Folder

Results 1 to 2 of 2

Thread: Getting File Folder

  1. #1
    Join Date
    Dec 1969

    Default Getting File Folder

    I know what I want can't be too hard to get, but I just can't seem to figure it out. I want to get JUST THE PATH to a particular file. I've tried a GetFile.Path, but that returns the path AND the file name. I don't want the file name, just the path. I've tried "GetFolder", but it requires just a folder name. I've tried Server.MapPath, but it returns a Folder and file too. How can I simply get the path, and nothing more?

  2. #2
    Join Date
    Dec 1969

    Default RE: Getting File Folder

    If you want the entire path up to, but not including the file name, you can first use server.mappath, put the string into a variable (ie. named fullPath) and then use the InstRev and Left functions.<BR><BR>What that does is find the last occurence of "/" by using InstrRev to check the string from the end rather than the start, and then return everything to the left of it. <BR><BR>So...<BR>Define your fullPath variable then<BR>myPath = Left(fullPath,InstrRev(fullPath,"/")-1)

Posting Permissions

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