FileInfo issue - C# ASP.NET

Discussion in '.NET' started by tinhtam, Nov 16, 2007.

  1. tinhtam

    tinhtam

    Joined:
    Nov 15, 2007
    Messages:
    2
    Hi,
    I'm having a problem uploading an image when running a website from a share network. Could someone please give me some advice?

    Here's my code:

    *********************************
    <Code behind>
    string sfullpath = "C:\My Documents\My Pictures\Mypict.bmp";
    FileInfo imgFile = new FileInfo(sfullpath);

    if (!imgFile.Exists)
    {
    // Image not existed;
    }
    else
    {
    // Do something
    }
    ************************************

    Note: Everything is working fine if I run this website locally, but if I run it from another PC, it couldn't find the image file at all. However if I change sfullpath = "C:\Windows\Greenstone.bmp" it works fine. Is there something that I need to set from the web server to solve this problem? Please advice if you have any solutions. Thank you in advance.

    Tinhtam
    tinhtam, Nov 16, 2007
    #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. Antonio

    Problem creating FileInfo Array

    Antonio, Nov 23, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    1,763
    Maqsood Ahmed
    Dec 17, 2004
  2. Do
    Replies:
    1
    Views:
    2,099
    srinivas moorthy
    Dec 1, 2003
  3. Craig Douglas

    Ordering FileInfo[] by date

    Craig Douglas, Jan 30, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    348
    Craig Douglas
    Jan 30, 2004
  4. Martin Dechev
    Replies:
    0
    Views:
    525
    Martin Dechev
    Apr 2, 2004
  5. JJ

    FileInfo Issue

    JJ, Feb 5, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    501
Loading...

Share This Page