System.Web.HttpException: <path> is not a valid virtual path.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Shinis
    New Member
    • Jul 2008
    • 5

    System.Web.HttpException: <path> is not a valid virtual path.

    I developed a site using asp.net with vb script.In local machine its working fine..
    But when deployed it shows the following error

    its my code
    filepath = Server.MapPath( "http://www.mintmenadev .com/z/test/cms/Movies/" + FileUpload1.Fil eName)

    FileUpload1.Sav eAs(Server.MapP ath(filepath))

    it shows following error

    System.Web.Http Exception: 'http://www.mintmenadev .com/z/test/cms/Movies/RomanceMovieGen eric.flv' is not a valid virtual path.


    pls help me.......
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    Server.MapPath is for local filesystems only. An http:// url is not considered local.
    For example:
    Server.MapPath( @"\images")
    might return
    "C:\inetpub\www root\images\"

    Comment

    • Shinis
      New Member
      • Jul 2008
      • 5

      #3
      Originally posted by Plater
      Server.MapPath is for local filesystems only. An http:// url is not considered local.
      For example:
      Server.MapPath( @"\images")
      might return
      "C:\inetpub\www root\images\"
      thank you for your reply..........
      I tried this also "http://www.mintmenadev .com/z/test/cms/Movies/" & FileUpload1.Fil eName


      But it shows an error

      System.Web.Http Exception: The SaveAs method is configured to require a rooted path, and the path 'http://www.mintmenadev .com/z/test/cms/Movies/head.swf' is not rooted.


      pls help me.........
      thanks in advance........ .

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        That is the same thing. You are STILL using an http:// path. You need to provide a local path. Like the error message tells you.

        Comment

        Working...