Results 1 to 2 of 2

Thread: Way to strip file name from dynamic URL??

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2004
    Posts
    18

    Question Way to strip file name from dynamic URL??

    I need a way to strip out the file name from a dynamically generated URL. I need the path name only.

    example...
    ../../../folder1/folder2/varinglengthfilename.asp

    ruesult needed
    ../../../folder1/folder2/

    the path and file name will be different every time

    I am trying to use a server.variable (path_translated) but I don't want the file name

    Anyone know a way to do this?

    Thanks

  2. #2
    Addicted Member rdove's Avatar
    Join Date
    Dec 2002
    Location
    Indianapolis
    Posts
    251
    Code:
    <% 
    
    strFullPath = Request.ServerVariables("PATH_TRANSLATED")
    
    strSplitPath = Split(strFullPath, "\")
    
    For i = 0 To Ubound(strSplitPath) - 1
      strTempPath = strTempPath & strSplitPath(i) & "\"
    Next
    
    Response.Write(strTempPath)
    
    %>
    ~Ryan





    Have I helped you? Please Rate my posts.

Posting Permissions

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



Click Here to Expand Forum to Full Width