473,910 Members | 7,379 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 4145
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
7147
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
1934
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
3924
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
1422
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
15102
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
2324
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
2467
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
2091
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
5648
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
10037
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9879
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11349
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
10921
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
9727
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...
1
8099
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7250
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
6142
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4776
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

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.