MapPath plays up on me

Discussion in 'ASP.NET / ASP.NET Core' started by samcrn, Aug 16, 2010.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hello all

    Could you please point me in the right direction here?

    Works fine on my local IIS and code should execute without any problems on the outside host, i believe.

    This is a line of code that uploads a file onto a server.

    fileUploadControl.SaveAs(Server.MapPath("~/dir1/dir2/dir3/pdfs/") + System.IO.Path.GetFileName(fileUploadControl.FileName));



    What would be the problem in my case here?

    Thanks for the help in advance. :)


    p.s. error is of course:

    Could not find a part of the path
    'E:\web\shukokaisu\htdocs\dir1\dir2\dir3\pdfs\somefile.pdf'
     
  2. Heya wisemx, thanks for the quick reply.

    I knew about the suggestion you posted, many good articles as well there.

    Just saw that bottom level directory was not copied to the server.

    Created it and all works fine now.

    Thanks again.
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page