Login or Sign up Help | Site Map
Connecting Tech Pros Worldwide

Path=Server.MapPath

Question posted by: =?Utf-8?B?YzY3NjIyOA==?= (Guest) on August 5th, 2008 10:05 PM
Hi all,

I have one line code in my program, occasionaly I will receive the following
error:
"The Path parameter for the MapPath method did not correspond to a known path"

Path=Server.MapPath(sCertPath & "\" & order_id & ".pdf")


I am wondering what is happening since every time I check my error log, the
order_id value is not empty and sCertPath is a system variable.

Why does Server.Mappath fail?

can you share a hint?

--
Betty
Would you like to answer this question?
Sign up for a free account, or Login (if you're already a member).
Steven Cheng [MSFT]'s Avatar
Steven Cheng [MSFT]
Guest
n/a Posts
August 6th, 2008
04:05 AM
#2

Re: Path=Server.MapPath
Hi Betty,

From your descrpition, you ocassionally get some error at the
"Server.MapPath" call in your ASP application ,correct?

According to the codesnippet you provided, the Server.MapPath parameter is
concatenated via several string. As you said "sCerPath" is always
fixed(from environment variable), then the only part may vary is the
"order_id" variable, correct?

I've performed some research, it seems some possible causes is the path
contains some illegal characters, you can check the following thread:

http://www.xlinesoft.com/asprunnerp...use_strategy.ht
m

Also, a kb article mentioned the ".." parent path code is not allowed in
Server.MapPath.

http://support.microsoft.com/?id=332117

Sincerely,

Steven Cheng
Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
Join Bytes!.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscript...ault.aspx#notif
ications.

==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.--------------------
Quote:
Originally Posted by
>From: =?Utf-8?B?YzY3NjIyOA==?= <betty@newsgroup.nospam>
>Subject: Path=Server.MapPath
>Date: Tue, 5 Aug 2008 14:52:15 -0700

Quote:
Originally Posted by
>
>Hi all,
>
>I have one line code in my program, occasionaly I will receive the

following
Quote:
Originally Posted by
>error:
>"The Path parameter for the MapPath method did not correspond to a known

path"
Quote:
Originally Posted by
>
>Path=Server.MapPath(sCertPath & "\" & order_id & ".pdf")
>
>
>I am wondering what is happening since every time I check my error log,

the
Quote:
Originally Posted by
>order_id value is not empty and sCertPath is a system variable.
>
>Why does Server.Mappath fail?
>
>can you share a hint?
>
>--
>Betty
>



=?Utf-8?B?T2xkIFBlZGFudA==?='s Avatar
=?Utf-8?B?T2xkIFBlZGFudA==?=
Guest
n/a Posts
August 6th, 2008
07:05 AM
#3

Re: Path=Server.MapPath

"c676228" wrote:
Quote:
Originally Posted by
I have one line code in my program, occasionaly I will receive the following
error:
"The Path parameter for the MapPath method did not correspond to a known path"
>
Path=Server.MapPath(sCertPath & "\" & order_id & ".pdf")


Instead of *guessing* as our Microsoft friend would have you do, why not
find out, for real?

<%
virtualPath = sCertPath & "/" & order_id & ".pdf" ' should always use /
in virtual!
path = "*BAD*"
On Error Resume Next
path = Server.MapPath(virtualPath)
oops = Err.Description
On Error GoTo 0
If path = "*BAD*" Then ' means that the MapPath got the error!
Response.Write "Server.MapPath reported error: " & oops _
& "<p>The virtual path given was: " & virtualPath & "<HR>" &
vbNewLine
Response.End ' or you can try some recovery code...up to you
End If
%>

Let the program find and diagnose the problem--WHEN it occurs--for you.




Steven Cheng [MSFT]'s Avatar
Steven Cheng [MSFT]
Guest
n/a Posts
August 11th, 2008
09:05 AM
#4

Re: Path=Server.MapPath
Hi Betty,

Have you got any progress on this issue? If there is anything else need
help, please feel free to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
Join Bytes!.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscript...ault.aspx#notif
ications.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
Quote:
Originally Posted by
>From: Join Bytes! (Steven Cheng [MSFT])
>Organization: Microsoft
>Date: Wed, 06 Aug 2008 03:48:29 GMT
>Subject: RE: Path=Server.MapPath

Quote:
Originally Posted by
>
>Hi Betty,
>
>From your descrpition, you ocassionally get some error at the
>"Server.MapPath" call in your ASP application ,correct?
>
>According to the codesnippet you provided, the Server.MapPath parameter is
>concatenated via several string. As you said "sCerPath" is always
>fixed(from environment variable), then the only part may vary is the
>"order_id" variable, correct?
>
>I've performed some research, it seems some possible causes is the path
>contains some illegal characters, you can check the following thread:
>
>http://www.xlinesoft.com/asprunnerp..._use_strategy.h

t
Quote:
Originally Posted by
>m
>
>Also, a kb article mentioned the ".." parent path code is not allowed in
>Server.MapPath.
>
>http://support.microsoft.com/?id=332117
>
>Sincerely,
>
>Steven Cheng
>Microsoft MSDN Online Support Lead
>
>
>Delighting our customers is our #1 priority. We welcome your comments and
>suggestions about how we can improve the support we provide to you. Please
>feel free to let my manager know what you think of the level of service
>provided. You can send feedback directly to my manager at:
>msdnmg@microsoft.com.
>
>==================================================
>Get notification to my posts through email? Please refer to
>http://msdn.microsoft.com/subscript...fault.aspx#noti

f
Quote:
Originally Posted by
>ications.
>
>==================================================
>This posting is provided "AS IS" with no warranties, and confers no
>rights.--------------------
>
Quote:
Originally Posted by
>>From: =?Utf-8?B?YzY3NjIyOA==?= <betty@newsgroup.nospam>
>>Subject: Path=Server.MapPath
>>Date: Tue, 5 Aug 2008 14:52:15 -0700

>
Quote:
Originally Posted by
>>
>>Hi all,
>>
>>I have one line code in my program, occasionaly I will receive the

>following
Quote:
Originally Posted by
>>error:
>>"The Path parameter for the MapPath method did not correspond to a known

>path"
Quote:
Originally Posted by
>>
>>Path=Server.MapPath(sCertPath & "\" & order_id & ".pdf")
>>
>>
>>I am wondering what is happening since every time I check my error log,

>the
Quote:
Originally Posted by
>>order_id value is not empty and sCertPath is a system variable.
>>
>>Why does Server.Mappath fail?
>>
>>can you share a hint?
>>
>>--
>>Betty
>>

>
>



 
Not the answer you were looking for? Post your question . . .
182,318 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

  • Didn't find the answer you were looking for?
    Post Your Question
  • Top Community Contributors