Computer A is running an application that needs to find a certain file in an
FTP site folder that is also on computer A.
The user that is logged on to computer A is the domain administrator (the
computer runs 24-7 without user interaction)
The FTP site folder the program looks at is restricted access. Only users
with the username and password given them and part of the local users group
can see its contents and download from it or upload to it.
In addition the domain administrators and authenticated users have full
access to the FTP folder.
However when my program tries to find a folder with a certain name, and I
can see that it is there and the name and location are correct, the program
returns false.
The code is
Private Function FileExists(ByVal fileName As String) As Boolean
'Arguments : fileName - Name & Location of the file to check
'Returns : True if the caller has the required permissions
' and path contains the name of an existing file;
' otherwise, False. This method also returns false
' if path is a null reference (Nothing in Visual
' Basic) or a zero-length string.
Return System.IO.File.Exists(fileName)
End Function
Since this function returns True in my test environment where I do not have
the same restrictions on the FTP test folder My suspicion is that the caller
does not have appropriate permissions to view the folder's contents.
Question is what permission do I have to set to allow this access to the FTP
folder for my application?
Any help would be greatly appreciated.
RD
Nicole Calinoiu - 18 May 2005 19:34 GMT
What happens when you use Directory.Exists rather than File.Exists to test
the existence of the folder?
> Computer A is running an application that needs to find a certain file in
> an
[quoted text clipped - 43 lines]
>
> RD
RD - 19 May 2005 15:25 GMT
I need to test the existence of a particular file. Thats why I did not use
Directory.exists. I can try it and add some loging to the functions to see
what I get back when they execute.
RD
> What happens when you use Directory.Exists rather than File.Exists to test
> the existence of the folder?
[quoted text clipped - 46 lines]
> >
> > RD
Nicole Calinoiu - 19 May 2005 19:59 GMT
Sorry, but you did say "when my program tries to find a folder with a
certain name". <g>
What happens when you try to find the target file via Windows Explorer when
running under the same account as the application? Can you open every
parent folder in the folder hierarchy above the target file? Can you open
the target file itself for reading?
>I need to test the existence of a particular file. Thats why I did not use
> Directory.exists. I can try it and add some loging to the functions to see
[quoted text clipped - 58 lines]
>> >
>> > RD
Yunus Emre ALPÖZEN [MCAD.NET] - 18 May 2005 21:11 GMT
Dow do u access ftp folder ?? Writing full path like C:\Inetpub\ftproot\ ?
Otherwise it uses network security zone instead of using local security
zone...

Signature
Thanks,
Yunus Emre ALPÖZEN
BSc, MCAD.NET
> Computer A is running an application that needs to find a certain file in
> an
[quoted text clipped - 43 lines]
>
> RD
RD - 19 May 2005 15:23 GMT
Yeah, I'm using the full local path
c:\inetpub\ftproot\myFTPSitefoldername\myfilename to try to find the file.
This morning again at the prescribed time it tried to find the file and it
in the folder OK, but the function looking for it returned false, it could
not find it again.
It sure looks like a permission problem, cause I have exactly the same
folder structure and files on my development machine and it works fine
there. Darn.....
RD
> Dow do u access ftp folder ?? Writing full path like C:\Inetpub\ftproot\ ?
> Otherwise it uses network security zone instead of using local security
[quoted text clipped - 47 lines]
> >
> > RD
RD - 23 May 2005 16:46 GMT
Thanks to all of you , I worked it out, was an error in my code.
I was looking for a file without giving it the full pathname only the
filename.
DUMB!
Sorry to have bothered you.
> Computer A is running an application that needs to find a certain file in an
> FTP site folder that is also on computer A.
[quoted text clipped - 37 lines]
>
> RD