Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Remote FileExists problem

Remote FileExists problem

Scheduled Pinned Locked Moved C#
windows-adminhelpquestioncsharpsysadmin
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    DougW48
    wrote on last edited by
    #1

    Before I even start, I apologize for asking a NON-C# question in here. I've posted questions in nearly every forum in this site, and the responses in this one are by far the best. On that note, here is my question: We have a situation at work where we've encountered a problem with accessing files which are located on another machine as the IIS server. We're using the File System Object to access these remote files. The problem is that the FileExists function always returns false for a file on another machine. This is a permissions issue, and I have some workarounds for it. Setting up a user account on the remote machine for the IUSR_COMPNAME account isn't really feasible, since this needs to be in commercial software, and the password for this account is generated dynamically. Yes, we could hack the registry and get this, but it's something we're trying to avoid. We could also have the ASP page start an external application to access the file, but again, we have the overhead of starting and ending a separate application, as well as the fact that we have to set up some way of giving this application the names of the actual files to access. I guess my question is, is there a method of doing this which actually works? If I search the web, I see that this issue has come up a lot...and the only real work-around I've seen is putting the IUSR account on the remote machine. Is there another way, and if so, what are the steps, or where can I find a quality article on this topic? Again, while this isn't a pure C# question, it's still an issue that somebody using C# might face, so it's worth sharing. Thanks everybody.

    S 1 Reply Last reply
    0
    • D DougW48

      Before I even start, I apologize for asking a NON-C# question in here. I've posted questions in nearly every forum in this site, and the responses in this one are by far the best. On that note, here is my question: We have a situation at work where we've encountered a problem with accessing files which are located on another machine as the IIS server. We're using the File System Object to access these remote files. The problem is that the FileExists function always returns false for a file on another machine. This is a permissions issue, and I have some workarounds for it. Setting up a user account on the remote machine for the IUSR_COMPNAME account isn't really feasible, since this needs to be in commercial software, and the password for this account is generated dynamically. Yes, we could hack the registry and get this, but it's something we're trying to avoid. We could also have the ASP page start an external application to access the file, but again, we have the overhead of starting and ending a separate application, as well as the fact that we have to set up some way of giving this application the names of the actual files to access. I guess my question is, is there a method of doing this which actually works? If I search the web, I see that this issue has come up a lot...and the only real work-around I've seen is putting the IUSR account on the remote machine. Is there another way, and if so, what are the steps, or where can I find a quality article on this topic? Again, while this isn't a pure C# question, it's still an issue that somebody using C# might face, so it's worth sharing. Thanks everybody.

      S Offline
      S Offline
      Salil Khedkar
      wrote on last edited by
      #2

      I think if you are trying to do this with the ASP code you need to explicitely map the logical path to a physical one before trying the FileExists() function. Search on these lines.

      D 1 Reply Last reply
      0
      • S Salil Khedkar

        I think if you are trying to do this with the ASP code you need to explicitely map the logical path to a physical one before trying the FileExists() function. Search on these lines.

        D Offline
        D Offline
        DougW48
        wrote on last edited by
        #3

        No, it doesn't work by mapping to a virtual directory either. I wouldn't have posted this question if it were that easy...thank you though for the suggestion.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups