views:

497

answers:

2

I have an HttpPostedFile object, when i try saving it via SaveAs i get this exception System.Web.HttpException

"The SaveAs method is configured to require a rooted path, and the path './tempUpload/4' is not rooted."

Why? how do i correct it?

A: 

ASP.NET doesn't like the dot in your path. Try 'tempUpload/4' instead.

Pavel Chuchuva
+2  A: 

The path should be an absolute path, not a relative url.

Use the Server.MapPath method to get the absolute path from your relative url.

Guffa