folder details?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bam

    folder details?

    Is there a way to get the subfolder, and folder that a file is in, using the
    filesystem or something else??

    Let's say my user.asp file is user specific.

    it would be located in folders as follows

    user/uni/user.asp

    i would need a way of finding what the subfolder the file is in, as well as
    the root folder it is in.

    is this possible??

    --
    Thanks,
    Bam


  • Evertjan.

    #2
    Re: folder details?

    Bam wrote on 16 aug 2007 in microsoft.publi c.inetserver.as p.general:
    Is there a way to get the subfolder, and folder that a file is in,
    using the filesystem or something else??
    >
    Let's say my user.asp file is user specific.
    >
    it would be located in folders as follows
    >
    user/uni/user.asp
    >
    i would need a way of finding what the subfolder the file is in, as
    well as the root folder it is in.
    >
    is this possible??
    <%=Request.Serv erVariables("UR L")%>

    <%=Request.Serv erVariables("PA TH_INFO")%>

    <%=Request.Serv erVariables("PA TH_TRANSLATED") %>

    <%=Request.Serv erVariables("AP PL_PHYSICAL_PAT H")%>


    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)

    Comment

    • Bam

      #3
      Re: folder details?

      ....
      Bam wrote on 16 aug 2007 in microsoft.publi c.inetserver.as p.general:
      >
      >Is there a way to get the subfolder, and folder that a file is in,
      >using the filesystem or something else??
      >>
      >Let's say my user.asp file is user specific.
      >>
      >it would be located in folders as follows
      >>
      >user/uni/user.asp
      >>
      >i would need a way of finding what the subfolder the file is in, as
      >well as the root folder it is in.
      >>
      >is this possible??
      >
      <%=Request.Serv erVariables("UR L")%>
      >
      <%=Request.Serv erVariables("PA TH_INFO")%>
      >
      <%=Request.Serv erVariables("PA TH_TRANSLATED") %>
      >
      <%=Request.Serv erVariables("AP PL_PHYSICAL_PAT H")%>
      >
      >
      --
      Evertjan.
      The Netherlands.
      (Please change the x'es to dots in my emailaddress)
      Thanks for the reply, but that is only part of what I need.
      the path_info and URL shows the same thing. What I need IS contained in
      there, but is there a way to extract it?

      so I could use the info like this. Say......

      Request.ServerV ariables("PATH_ INFO")

      gives me this for example::

      Bam/uni30/index.asp Now what I need is to extract out the Bam varUSER
      = "Bam" and varUNI = 30

      is there a way to do this??



      Comment

      • Daniel Crichton

        #4
        Re: folder details?

        Bam wrote on Thu, 16 Aug 2007 07:07:33 -0400:
        ...
        >Bam wrote on 16 aug 2007 in microsoft.publi c.inetserver.as p.general:
        >>Is there a way to get the subfolder, and folder that a file is in,
        >>using the filesystem or something else??
        >>Let's say my user.asp file is user specific.
        >>it would be located in folders as follows
        >>user/uni/user.asp
        >>i would need a way of finding what the subfolder the file is in, as
        >>well as the root folder it is in.
        >>is this possible??
        ><%=Request.Ser verVariables("U RL")%>
        ><%=Request.Ser verVariables("P ATH_INFO")%>
        ><%=Request.Ser verVariables("P ATH_TRANSLATED" )%>
        ><%=Request.Ser verVariables("A PPL_PHYSICAL_PA TH")%>
        >--
        >Evertjan.
        >The Netherlands.
        >(Please change the x'es to dots in my emailaddress)
        Thanks for the reply, but that is only part of what I need.
        the path_info and URL shows the same thing. What I need IS contained in
        there, but is there a way to extract it?
        so I could use the info like this. Say......
        Request.ServerV ariables("PATH_ INFO")
        gives me this for example::
        Bam/uni30/index.asp Now what I need is to extract out the Bam varUSER
        = "Bam" and varUNI = 30
        is there a way to do this??
        Look at the Split function

        eg.

        vPathComponents = Split(Request.S erverVariables( "PATH_INFO" ),"/")

        in the case of Bam/uni30/index.asp you'll find this gives the following:

        vPathComponents (0) = "Bam"
        vPathComponents (1) = "uni30"
        vPathComponents (2) = "index.asp"

        So you can just use those array elements

        varUSER = vPathComponent( 0)
        varUNI = vPathComponent( 1)

        :)

        Dan


        Comment

        • Evertjan.

          #5
          Re: folder details?

          Bam wrote on 16 aug 2007 in microsoft.publi c.inetserver.as p.general:
          ><%=Request.Ser verVariables("U RL")%>
          >>
          ><%=Request.Ser verVariables("P ATH_INFO")%>
          >>
          ><%=Request.Ser verVariables("P ATH_TRANSLATED" )%>
          >>
          ><%=Request.Ser verVariables("A PPL_PHYSICAL_PA TH")%>
          [please do not quote signatures. Removed]

          Thanks for the reply, but that is only part of what I need.
          the path_info and URL shows the same thing. What I need IS contained
          in there, but is there a way to extract it?
          >
          so I could use the info like this. Say......
          >
          Request.ServerV ariables("PATH_ INFO")
          >
          gives me this for example::
          >
          Bam/uni30/index.asp Now what I need is to extract out the Bam
          varUSER = "Bam" and varUNI = 30
          >
          is there a way to do this??
          Yes, thast is simple string manipulation,
          and can be done, when you programme in asp-vbscript,
          using instr(), left(), mid(), right(),
          or, my preference, with Regex.

          Or, if you like asp-jscript,
          using the near equivalent functions,
          or in even more consize regex.

          Surely, you don't want to miss the joy of coding that yourself?

          --
          Evertjan.
          The Netherlands.
          (Please change the x'es to dots in my emailaddress)

          Comment

          • Bam

            #6
            Re: folder details?

            >Bam wrote on 16 aug 2007 in microsoft.publi c.inetserver.as p.general:
            >>
            >>Is there a way to get the subfolder, and folder that a file is in,
            >>using the filesystem or something else??
            >>>
            >>Let's say my user.asp file is user specific.
            >>>
            >>it would be located in folders as follows
            >>>
            >>user/uni/user.asp
            >>>
            >>i would need a way of finding what the subfolder the file is in, as
            >>well as the root folder it is in.
            >>>
            >>is this possible??
            >>
            ><%=Request.Ser verVariables("U RL")%>
            >>
            ><%=Request.Ser verVariables("P ATH_INFO")%>
            >>
            ><%=Request.Ser verVariables("P ATH_TRANSLATED" )%>
            >>
            ><%=Request.Ser verVariables("A PPL_PHYSICAL_PA TH")%>
            >>
            >>
            >--
            >Evertjan.
            >The Netherlands.
            >(Please change the x'es to dots in my emailaddress)
            >
            Thanks for the reply, but that is only part of what I need.
            the path_info and URL shows the same thing. What I need IS contained in
            there, but is there a way to extract it?
            >
            so I could use the info like this. Say......
            >
            Request.ServerV ariables("PATH_ INFO")
            >
            gives me this for example::
            >
            Bam/uni30/index.asp Now what I need is to extract out the Bam
            varUSER
            = "Bam" and varUNI = 30
            >
            is there a way to do this??

            Hey thanks guys. You guys rock!!

            I knew there was a way, but from being so sick, my mind isn't back to normal
            yet.

            Bam


            Comment

            • Bam

              #7
              Re: folder details?

              Look at the Split function
              >
              eg.
              >
              vPathComponents = Split(Request.S erverVariables( "PATH_INFO" ),"/")
              >
              in the case of Bam/uni30/index.asp you'll find this gives the following:
              >
              vPathComponents (0) = "Bam"
              vPathComponents (1) = "uni30"
              vPathComponents (2) = "index.asp"
              >
              So you can just use those array elements
              >
              varUSER = vPathComponent( 0)
              varUNI = vPathComponent( 1)
              >
              :)
              >
              Dan

              so my code should look like something like this?

              Request.ServerV ariables("PATH_ INFO")
              vPathComponents = Split(Request.S erverVariables( "PATH_INFO" ),"/")

              playername = vPathComponent( 0)
              vuniverse = vPathComponent( 1)

              am i missing something?


              Comment

              • Bam

                #8
                Re: folder details?

                never mind. with some tweaking i got it based on Daniel's post


                thanks again to both of you!!


                Comment

                Working...