Results 1 to 2 of 2

Thread: ServerVariables

  1. #1
    Join Date
    Dec 1969

    Default ServerVariables

    Hi, I was wondering if there is a method of getting just the file name (without the Path) from a ServerVariable

  2. #2
    Ben Welch Guest

    Default RE: ServerVariables

    Try this...<BR><BR>&#039Get the URL<BR>strURL = Request.ServerVariables("URL")<BR>&#039Work out the length of the URL<BR>strLengthURL = Len(strURL)<BR>&#039Find the last / character which indicates where the filename starts<BR>intFilenamePosition = InStrRev(strURL,"/")<BR>&#039Take the filename from the URL<BR>strFilename = Right(strURL,strLengthURL - intFilenamePosition)<BR><BR>Thanks,<BR><BR>Ben

Posting Permissions

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