I am trying to upload file but getting an error The given path's format is not supported."
string storageLocation = string.Empty;
string newFile;
switch (ddlDocType.SelectedItem.Text)
{
case "Letter":
storageLocation = Server.MapPath("~/Documents/Letters/");
break;
...
if (filePosted.ContentLength > 0)
{
filePosted.SaveAs(Path.Combine( storageLocation , newFile));
}
and also tried the following but still not working.
filePosted.SaveAs( storageLocation ,+ newFile);
How can I solve the problem?