Remote FileExists problem
-
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.
-
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.
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.
-
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.