473,386 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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 4104
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: JJ | last post by:
Hi, Using the app.config scenario and I added a Connectionstring to appSettings area in xml. In the value string I have the datasource equal to a absolute path on my dev machine. Now how can I...
1
by: psid | last post by:
hello, while I try to create my first web application in c#, I get the following error from the create new project dialog: "Unable to create web project <project_name>. The file path '\\server\...
4
by: Michael | last post by:
I am trying to open a file on the client machine from an aspx page running server side. The design requirements of the page specify that the HtmlInputFile control is not to be used. Since the...
2
by: Tom Nowak | last post by:
I have written a web page where if a user clicks a button, a xml file is generated and saved. I want to save the file in the folder that my project is in. I can specify to save the file in...
4
by: css | last post by:
When I call Directory.Exists for a UNC path like below... if (Directory.Exists(@\\SomeServer\C) == false) { .... } and that server does not exist on the connected network, it takes around a...
3
by: Gavin | last post by:
I need some help, I need the code to allow people that visit my website to be able to upload pictures to a file on my web server. I have been able to get close, but not quite there yet. Set fso...
1
by: fishy | last post by:
Hi all, I'vw written an asp.net web application that works just fine on my personal machine but when i moved it to the server folder there is this exception i'm getting while using export method of...
1
by: nalla | last post by:
iam working in a project where i need to provide a link to user such that he can download a word Document from server (not my local pc).iam able to do this from my localhost ,but from other pc i...
4
by: Dave | last post by:
The below code is what I'm using to upload JPG's to a Shared folder on my web server. The folder \\GLSDBS03\Entry$ is outside my Web folder. When using FileUpload, and trying to save the JPG, I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.