473,385 Members | 1,720 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,385 software developers and data experts.

MapPath invalid character error

Hi,
I'm trying to use MapPath on a folder named with a comma in it:

xmldoc.load Server.MapPath(Request.QueryString("fname"))

where the querysting is something like "fname=this, that/this, that.xml".

I'm sure it's the comma, because if I remove it and rename the file
and folder, everything works.
I believe that a comma is a valid character in a folder or filename,
so why does MapPath barf on it?
Is there any way around this still using MapPath?
Can someone point me to a source with a list of the valid characters
the MapPath accepts?

Thanks,
Supertzar

Jul 19 '05 #1
4 5577
http://www.aspfaq.com/2302


"Supertzar" <Su*******@BS.invalid> wrote in message
news:mc********************************@4ax.com...
Hi,
I'm trying to use MapPath on a folder named with a comma in it:

xmldoc.load Server.MapPath(Request.QueryString("fname"))

where the querysting is something like "fname=this, that/this, that.xml".

I'm sure it's the comma, because if I remove it and rename the file
and folder, everything works.
I believe that a comma is a valid character in a folder or filename,
so why does MapPath barf on it?
Is there any way around this still using MapPath?
Can someone point me to a source with a list of the valid characters
the MapPath accepts?

Thanks,
Supertzar

Jul 19 '05 #2
Hi Supertzar,

From my research it looks like this is a known issue, Microsoft has
known for years, but no fix is available.

What you'll have to do is break the path down in code and only do
Server.MapPath on the portion you know is safe.

What I had was a file name for which I needed to know the absolute
path on my disk, so I did this:
strFullPath = Server.MapPath(".") & "\" & strMyFileNameWithCommas

Hope this helps.
David

Supertzar <Su*******@BS.invalid> wrote in message news:<mc********************************@4ax.com>. ..
Hi,
I'm trying to use MapPath on a folder named with a comma in it:

xmldoc.load Server.MapPath(Request.QueryString("fname"))

where the querysting is something like "fname=this, that/this, that.xml".

I'm sure it's the comma, because if I remove it and rename the file
and folder, everything works.
I believe that a comma is a valid character in a folder or filename,
so why does MapPath barf on it?
Is there any way around this still using MapPath?
Can someone point me to a source with a list of the valid characters
the MapPath accepts?

Thanks,
Supertzar

Jul 19 '05 #3
I'm having the same issue. My filename contains a
comma. Have you found a workaround using server.mappath?

Steve
-----Original Message-----
http://www.aspfaq.com/2302


"Supertzar" <Su*******@BS.invalid> wrote in message
news:mc********************************@4ax.com.. .
Hi,
I'm trying to use MapPath on a folder named with a comma in it:
xmldoc.load Server.MapPath(Request.QueryString ("fname"))
where the querysting is something like "fname=this, that/this, that.xml".
I'm sure it's the comma, because if I remove it and rename the file and folder, everything works.
I believe that a comma is a valid character in a folder or filename, so why does MapPath barf on it?
Is there any way around this still using MapPath?
Can someone point me to a source with a list of the valid characters the MapPath accepts?

Thanks,
Supertzar

.

Jul 19 '05 #4
> I'm having the same issue. My filename contains a
comma. Have you found a workaround using server.mappath?


This article might help...
http://www.aspfaq.com/2302
Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Lopa | last post by:
I get an error "006~ASP 0173~Invalid Path Character~An invalid character was specified in the Path parameter for the MapPath method.", while using the Server.Mappath function. but i have not been...
6
by: Dan Sikorsky | last post by:
How do you use server.mappath to update a access database on a completely different computer? One of my websites needs to update a database on a completely different website. Example: My ASP...
7
by: A P | last post by:
I receive an error like this: Server.MapPath() error 'ASP 0172 : 80004005' Invalid Path /conn.asp, line 2 The Path parameter for the MapPath method must be a virtual path. A physical path...
3
by: Kaidi | last post by:
Hello guys, I get the "an invalid XML character" error when using xerces to parse a XML file. I know that XML will correspond the &, <, >, " to special strings like "&gt;&lt;". However, how about if the...
0
by: majiofpersia | last post by:
Hi all, I am confused the mappath does not support virtual directories any more? I realize that the ".." for the virtual directory to go to a higher level root is not supported in .NET any longer...
0
by: Martin Pahlplatz | last post by:
When I use server.mappath("a,b") IIS returns the following message: 'Error Type: Server.MapPath(), ASP 0173 (0x80004005) An invalid character was specified in the Path parameter for the MapPath...
1
by: King Kong | last post by:
we are facing this kind of error when we double click the infragistic web grid please help me on this Regards Moid Iqbal Server Error in '/NetworkAccess' Application....
0
by: =?Utf-8?B?YWptZWhyYQ==?= | last post by:
I am trying to save a file to c:\inetpub\wwwroot\temp and I am using this code ln 1 For Each objFile In objUpload.Files ln 2 objFile.SaveAs(Server.MapPath("/temp/") & objFile.Name) ln 3...
1
by: =?Utf-8?B?UGF1bCBQaGlsbGlwcw==?= | last post by:
I have read many things about this but I haven't got a clear vision on what to do if anything about this. I have a system that tries to find holes in my web site. One of the things it has...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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.