469,908 Members | 2,213 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,908 developers. It's quick & easy.

Path=Server.MapPath

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
Aug 5 '08 #1
3 3937
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/asprunnerpr...se_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:
ms****@microsoft.com.

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

==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.--------------------
>From: =?Utf-8?B?YzY3NjIyOA==?= <be***@newsgroup.nospam>
Subject: Path=Server.MapPath
Date: Tue, 5 Aug 2008 14:52:15 -0700
>
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
Aug 6 '08 #2

"c676228" wrote:
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.

Aug 6 '08 #3
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:
ms****@microsoft.com.

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

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>From: st*****@online.microsoft.com (Steven Cheng [MSFT])
Organization: Microsoft
Date: Wed, 06 Aug 2008 03:48:29 GMT
Subject: 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/asprunnerpr...use_strategy.h
t
>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:
ms****@microsoft.com.

================================================= =
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ault.aspx#noti
f
>ications.

================================================= =
This posting is provided "AS IS" with no warranties, and confers no
rights.--------------------
>>From: =?Utf-8?B?YzY3NjIyOA==?= <be***@newsgroup.nospam>
Subject: Path=Server.MapPath
Date: Tue, 5 Aug 2008 14:52:15 -0700
>>
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

Aug 11 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by JJ | last post: by
1 post views Thread by psid | last post: by
4 posts views Thread by Michael | last post: by
2 posts views Thread by Tom Nowak | last post: by
3 posts views Thread by Gavin | last post: by
1 post views Thread by fishy | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.