Connecting Tech Pros Worldwide Help | Site Map

MapPath fails

David
Guest
 
Posts: n/a
#1: Nov 17 '06
My ASP.Net 2.0 page (VB) is failing when trying to use the MapPath method on
a virtual directory that contains a comma and a period (see below), but I'm
not sure why as those are acceptable characters for a folder name. How can
I get ariound that? Thanks.

strFilePath = "Documents/File090217/0005ComputerPackages, Inc."

strFilePathPhy = HttpContext.Current.Server.MapPath(strFilePath)


David


Rad [Visual C# MVP]
Guest
 
Posts: n/a
#2: Nov 17 '06

re: MapPath fails


That's probably because it seems illegal to have a folder name that
ends with a .

Try creating a folder with a name that ends with a . , or renaming one
to end with a . Windows ignores the full stop!

On Fri, 17 Nov 2006 15:10:07 -0600, "David" <dlchase@lifetimeinc.com>
wrote:
Quote:
>My ASP.Net 2.0 page (VB) is failing when trying to use the MapPath method on
>a virtual directory that contains a comma and a period (see below), but I'm
>not sure why as those are acceptable characters for a folder name. How can
>I get ariound that? Thanks.
>
>strFilePath = "Documents/File090217/0005ComputerPackages, Inc."
>
>strFilePathPhy = HttpContext.Current.Server.MapPath(strFilePath)
>
>
>David
>
--

Bits.Bytes.
http://bytes.thinkersroom.com
David Wier
Guest
 
Posts: n/a
#3: Nov 17 '06

re: MapPath fails



Also - when you say it fails, exactly what is happening?
if you're adding a filename to it, at some point - try adding a slash to the
end of the directory (strFilePath)

--
David Wier
MVP/ASPInsider
http://aspnet101.com
http://aspexpress.com


"David" <dlchase@lifetimeinc.comwrote in message
news:O$lTIzoCHHA.4832@TK2MSFTNGP06.phx.gbl...
Quote:
My ASP.Net 2.0 page (VB) is failing when trying to use the MapPath method
on
Quote:
a virtual directory that contains a comma and a period (see below), but
I'm
Quote:
not sure why as those are acceptable characters for a folder name. How
can
Quote:
I get ariound that? Thanks.
>
strFilePath = "Documents/File090217/0005ComputerPackages, Inc."
>
strFilePathPhy = HttpContext.Current.Server.MapPath(strFilePath)
>
>
David
>
>

Closed Thread