sroughley
06-17-2003, 05:58 AM
Hey all.
It's my first post here and I have only been developing in ASP for a month now (previously worked with PHP) so forgive me if I seem ignorant.
The problem is this. I have a string that contains a user specified web directory that exists on a server (lets say "../../sounds").
I am trying to use this directory to build a string using the request.servervariables("PATH_INFO") that will create a full server path to the sounds folder.
Now, I need to be able to identify how many ../'s are at the beginning of the directory string and remove the same amount of directories from the end of the PATH_INFO string before appending the directory string to the end of the PATH-INFO string.
So if PATH_INFO returns:
//servername/s/somesite.com/htdocs/app/admin/
and we have the directory string:
../../sounds
The final string will be
//servername/s/somesite.com/htdocs/sounds/
Any ideas?
Regards.
Steve.
It's my first post here and I have only been developing in ASP for a month now (previously worked with PHP) so forgive me if I seem ignorant.
The problem is this. I have a string that contains a user specified web directory that exists on a server (lets say "../../sounds").
I am trying to use this directory to build a string using the request.servervariables("PATH_INFO") that will create a full server path to the sounds folder.
Now, I need to be able to identify how many ../'s are at the beginning of the directory string and remove the same amount of directories from the end of the PATH_INFO string before appending the directory string to the end of the PATH-INFO string.
So if PATH_INFO returns:
//servername/s/somesite.com/htdocs/app/admin/
and we have the directory string:
../../sounds
The final string will be
//servername/s/somesite.com/htdocs/sounds/
Any ideas?
Regards.
Steve.