472,372 Members | 1,775 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,372 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 4031
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...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...

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.