Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Invalid Path Character -server.mappath function

Status
Not open for further replies.

lpatnaik

Programmer
Jul 11, 2002
53
0
0
Hi I am getting this error "006~ASP 0173~Invalid Path Character~An invalid character was specified in the Path parameter for the MapPath method.", while using the Server.MapPath function. Can anyone tell me what all characters are not supported by this function or does Microsoft has any list of such characters, so that i can validate which characters can cause problems.
 
i need ur code to answer this qs.

Known is handfull, Unknown is worldfull
 
The most likely problem -- without seeing your code -- is that you typed a slash (/) instead of a backslash (\) when specifying your path. Server.MapPath doesn't seem to like that -- it's a DOS thing. :)

I know I've done it more than once.
 
I am using this code..

Server.MapPath("../../images/designers/" & DesignerPicName & ".jpg")

This picks up the image file from the images/designers folder. Since there are thousands of jpgs in this folder, i wanted to know what could be the possible invalid characters. No "\" or "/" is definetly not the issue here.
 
like Genimuse said:
Server.MapPath("../../images\designers\" & DesignerPicName & ".jpg")



Known is handfull, Unknown is worldfull
 
The files are already on your server, ergo their names are valid.

Server.MapPath doesn't have any special valid or invalid characters that are any different from the operating system's.
 
response.write out the full path to see what is tripping up server.mappath just in case there is an extra "/" or something else added to DesignerPicName or if indeed it is empty.
Depending where (and how) this variable is assigned a value, all or any of the above could occur.

been there, done that,

More code will help



Chris.

Indifference will be the downfall of mankind, but who cares?
 
The problem here may be the ..'s. Make sure in IIS that you have allowed the option for those folders to access their parent folders. To enable this option in the Internet Services Manager, rt click the web server you wish to edit (default for example), select properties, click the home directory tab, select configuration in Application Settings, select the App Options tab, Click the Enable Parent Paths option. That will give children directories permission to accesss filers through their parent directories. If it is not already selected than that is likely your error in this case.

-Tarwn

[sub]01000111 01101111 01110100 00100000 01000011 01101111 01100110 01100110 01100101 01100101 00111111[/sub]
minilogo.gif alt=tiernok.com
The never-completed website
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top