473,700 Members | 2,349 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Path=Server.Map Path

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.Map Path(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 4124
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****@microsof t.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***@newsgrou p.nospam>
Subject: Path=Server.Map Path
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.Ma pPath(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.Map Path(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.Map Path 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****@microsof t.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.Map Path
>
Hi Betty,

From your descrpition, you ocassionally get some error at the
"Server.MapPat h" 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****@microso ft.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***@newsgrou p.nospam>
Subject: Path=Server.Map Path
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.M apPath(sCertPat h & "\" & 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
7139
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 set it to be relative to where my project gets deployed to? Do I use Application.Startup in the connection string startup as so : <appSettings> <add key="myCon" value="{"Jet OLEDB:Database Password=;Data Source=" +
1
1929
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\ wwwroot$\webApplication' does not correspond to the URL 'http://server/ webApplication' the two need to map to the same server location. HTTP error 404: not found" There is a web server, while the development environment run on a separate machine...
4
3903
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 HtmlInputFile has an HttpPostedFile object containing the client side path to the selected file, there must be some way to resolve this path server side allowing me to open the file with as Stream object.. I've been looking at WebClient.OpenRead,...
2
1417
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 "c:\inetpub\wwwroot\folder\bin\test.xml", but I want to use the relative path to specify the place to save it. How do I do this?
4
15092
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 minute to return from the call which properly returns false.
3
2308
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 = createobject("scripting.filesystemobject") Set act = fso.CreateTextFile(server.mappath("test.jpg"), true) act.WriteLine act.Close The above code will create the file but will not write any data in it. Below
1
2456
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 an OWC11 object. there are 2 things i don't really understand, 1. why do i get this exception on the server and not on my personal machine ? 2. in the Exception details, the error pointing the page located on my machine (when the application...
1
2072
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 need to use System.Net.WebRequest but i donot know how to use it. code for access from localhost: string filename="anjit.doc";
4
5631
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 get a "Failed to map the path '/GLSDBS03/Entry$'" error. I'm open to suggestions or a better idea. Thanks *********************************************
0
9214
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9075
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8925
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7810
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5903
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4657
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3089
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2392
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2028
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.