Ask a Question related to ASP.NET General, Design and Development.
-
Alvin Bruney #1
Re: Invalid path for MapPath
paste the entire path in the error string into your browser address bar. it
should attempt to open the file, if not your path is incorrect.
"Arjen" <boah123@hotmail.com> wrote in message
news:bg13or$m1s$1@news1.tilbu1.nb.home.nl...is> Hello,
>
> I want to upload a file to my webserver, here is a little bit of my code:
>
> // Calculate virtualPath of the newly uploaded file
> virtualPath = Application["AppPath"] + "/Uploads/" + moduleId.ToString() +
> "/" + Path.GetFileName(FileUpload.PostedFile.FileName);
>
> // Calculate physical path of the newly uploaded file
> String phyiscalPath = Server.MapPath(virtualPath);
>
> // Save file to uploads directory
> FileUpload.PostedFile.SaveAs(phyiscalPath);
>
> Here is my error message:
> Invalid path for MapPath
> 'http://localhost/MyWebApplication/Uploads/18/Image.png'. A virtual path> expected.
> // Calculate physical path of the newly uploaded file
> Line 5: String phyiscalPath =
> Server.MapPath(virtualPath);
>
> What's wrong?
>
> Can somebody give me a solution?
>
> Thanks!
>
>
Alvin Bruney Guest
-
Error at Map Path System.Mappath()
Shree Ganesha I am unable to use the following server.mappath("../database/data.mdb") please tell me a walk around -
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... -
Server.MapPath returning wrong path
I've got the directory f:\Company\Product set as web shared so it's got a virtual directory in the default web site on my test server's IIS. If I... -
FSO: Invalid Path - why??
Hi- I am trying to use the FSO to do some file work. I have a little bit of code like this: -
#24763 [Opn->NoF]: Invalid path
ID: 24763 Updated by: iliaa@php.net Reported By: gcctang at hku dot hk -Status: Open +Status: No...



Reply With Quote

