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...
> 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
is
> 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!
>
>