Invalid path for MapPath 'c:\'. A virtual path is expected.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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 Next
I end up getting an error on ln 2:

System.ArgumentException: Invalid path for MapPath 'c:\'. A virtual path is
expected.

Any help will be appreciated

Thanks
AJ
 
Back
Top