MapPath fails

D

David

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
 
R

Rad [Visual C# MVP]

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!
 
D

David Wier

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,241
Members
46,831
Latest member
RusselWill

Latest Threads

Top