|
it
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
file system object doesn't work in virtual path?
to a file on my app server. I am using the file system object to check for the existance of the file and if it exists, it has to validate the file date. The problem is I can't seem to find the file. I can successfully check for the existance of a file on the web server, but once I enter the virtual path it can't find anything. All three of these calls return false... fso.FileExists("http://server/localfolder/virtualfolder/test.txt") fso.FileExists("/localfolder/virtualfolder/test.txt") fso.FileExists(Server.MapPath("/localfolder/virtualfolder/test.txt")) However these two calls work, so I assume I am referencing the file correctly... Response.Redirect "http://server/localfolder/virtualfolder/test.txt" Response.Redirect "/localfolder/virtualfolder/test.txt" Am I doing something wrong here? The virtual path is setup with an id that has full access to the folder. Thanks. mbosc***@hotmail.com wrote:
> This is the only one that should work. FileSystemObjects need a file-system> fso.FileExists("http://server/localfolder/virtualfolder/test.txt") > fso.FileExists("/localfolder/virtualfolder/test.txt") > fso.FileExists(Server.MapPath("/localfolder/virtualfolder/test.txt")) paths, not urls. Server.MapPath returns a file-system path. > Why didn't you test this?> However these two calls work, so I assume I am referencing the file > correctly... > > Response.Redirect "http://server/localfolder/virtualfolder/test.txt" > Response.Redirect "/localfolder/virtualfolder/test.txt" Response.Write Server.MapPath("/localfolder/virtualfolder/test.txt") Does that display the correct file-system path? > If the correct file-system path is displayed, then there is a permissions> Am I doing something wrong here? The virtual path is setup with an id > that has full access to the folder. > problem. If your website has Anonymous access enabled, then the IUSR and IWAM accounts require access to the folder. It is those accounts that asp code run under when Anounymous is used (unless another account was configured to be used ). Otherwise, the users of your site need access. Bob Barrows -- Microsoft MVP -- ASP/ASP.NET Please reply to the newsgroup. The email account listed in my From header is my spam trap, so I don't check it very often. You will get a quicker response by posting to the newsgroup. Thanks Bob. Yes, Response.Write
Server.MapPath("/localfolder/virtualfolder/test.txt") returns the correct physical path. I will look into getting the IUSR and IWAM accounts access to the app server. I just need to create accounts using the same id/password on the app server, correct? I guess I was thrown off track because when I created the virtual folder it prompted me to enter a id/password. I entered one that does have rights to the app server, therefore I thought this would take care of all the permissions. If this id is not used when accessing the app server, then what is it for? Thanks. mbosc***@hotmail.com wrote:
> Thanks Bob. Yes, Response.Write No, they should already be there if IIS is installed.> Server.MapPath("/localfolder/virtualfolder/test.txt") returns the > correct physical path. I will look into getting the IUSR and IWAM > accounts access to the app server. I just need to create accounts > using the same id/password on the app server, correct? > > I guess I was thrown off track because when I created the virtual What tool did you use to create this virtual directory?> folder it prompted me to enter a id/password. > I entered one that does I'm not sure - I was never prompted for a id/password when creating a> have rights to the app server, therefore I thought this would take > care of all the permissions. If this id is not used when accessing > the app server, then what is it for? > virtual folder. -- Microsoft MVP -- ASP/ASP.NET Please reply to the newsgroup. The email account listed in my From header is my spam trap, so I don't check it very often. You will get a quicker response by posting to the newsgroup. IIS is installed on the web server, but not the app server. I thought
what you were saying is I need to create the same accounts on the app server, or did I misinterpret? I created the virtual directory within IIS. It first asked me for an alias, then a path. When you put in the path of a different server, it presents a screen that says... Security Credentials Enter the user name and password that should be used to gain access to the network directory. By default the following is checked: Always use the authenticated user's credentials when validating access to the network directory. I unchecked this and entered an id/password that I know has access to the folder on the app server (the one the virtual directory is pointing to). Thanks. Bob Barrows [MVP] wrote: Show quote > mbosc***@hotmail.com wrote: > > Thanks Bob. Yes, Response.Write > > Server.MapPath("/localfolder/virtualfolder/test.txt") returns the > > correct physical path. I will look into getting the IUSR and IWAM > > accounts access to the app server. I just need to create accounts > > using the same id/password on the app server, correct? > > > > No, they should already be there if IIS is installed. > > > I guess I was thrown off track because when I created the virtual > > folder it prompted me to enter a id/password. > > What tool did you use to create this virtual directory? > > > I entered one that does > > have rights to the app server, therefore I thought this would take > > care of all the permissions. If this id is not used when accessing > > the app server, then what is it for? > > > I'm not sure - I was never prompted for a id/password when creating a > virtual folder. > > -- > Microsoft MVP -- ASP/ASP.NET > Please reply to the newsgroup. The email account listed in my From > header is my spam trap, so I don't check it very often. You will get a > quicker response by posting to the newsgroup. mbosc***@hotmail.com wrote:
Show quote > IIS is installed on the web server, but not the app server. I thought There are still filesytem permissions to worry about. see this article:> what you were saying is I need to create the same accounts on the app > server, or did I misinterpret? > > I created the virtual directory within IIS. It first asked me for an > alias, then a path. When you put in the path of a different server, > it presents a screen that says... > > Security Credentials > Enter the user name and password that should be used to gain access to > the network directory. > > By default the following is checked: Always use the authenticated > user's credentials when validating access to the network directory. > > I unchecked this and entered an id/password that I know has access to > the folder on the app server (the one the virtual directory is > pointing to). > > Thanks. > http://www.aspfaq.com/show.asp?id=2168 -- Microsoft MVP -- ASP/ASP.NET Please reply to the newsgroup. The email account listed in my From header is my spam trap, so I don't check it very often. You will get a quicker response by posting to the newsgroup. |
|||||||||||||||||||||||