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

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
 

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

Top