Server.MapPath FileNotFound problem

Discussion in 'ASP .Net' started by Aahz, Aug 9, 2005.

  1. Aahz

    Aahz Guest

    Hello, I have a problem with Server.MapPath founding file

    I have huge project in virtual directory "Proj" located in
    "My Documents/Proj" and all my project files are there.

    Now I need to use a "picture.png" located in "Proj/pictures" directory.
    Code is:
    Image img= Bitmap.FromFile(Server.MapPath("pictures/picture.png"));

    .... and problem is that my application crashes and in Exception Details
    is see that picture is looked for in
    "c:\inetpub\wwwroot\pictures\picture.png" ,
    instead in "Proj/pictures"

    I tried several version of path, ie: (../pict.., ..\pictures\pic.,
    \pictures, @(\pictures.. )
    and nothing worked !

    Anyone see any solution please ??
    Thanks;
     
    Aahz, Aug 9, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. niju

    System.IO.Filenotfound error

    niju, Nov 9, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    656
  2. =?Utf-8?B?dHBhcmtzNjk=?=

    server.mappath vs. request.mappath

    =?Utf-8?B?dHBhcmtzNjk=?=, Mar 10, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    1,228
    Juan T. Llibre
    Mar 11, 2007
  3. Replies:
    4
    Views:
    1,009
    Juan T. Llibre
    Oct 7, 2007
  4. KevinSimonson
    Replies:
    8
    Views:
    767
  5. Rhett Shoemaker

    Soap/FileNotFound exception

    Rhett Shoemaker, Oct 6, 2004, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    122
    Rhett Shoemaker
    Oct 6, 2004
Loading...

Share This Page