Re: Permission Denied After Calling ListDir (General questions)
Here is some of the pertinent code...
'Connecting to Server...
Private Sub Command1_Click()
FTP1.Blocking = True
FTP1.Protocol = FTPSwithdata
On Error GoTo ErrorHandler
FTP1.Connect
Text1.Text = Connected
Exit Sub
ErrorHandler:
If Err.Number <> 0 Then 'Succes
msgbox Connected
End If
End Sub
'Looking for Remote Directory, Creating if it doesn't exist
Private Function CheckSwitchRemoteDir()
On Error Resume Next
If bConnected Then
FTP1.CheckDir CustomerJobsSomeSubFolder 'Root Directory = CustomerJobs
If Err.Number = 40550 Then 'Directory Does Not Exist
CheckSwitchRemoteDir = False
FTP1.MakeDir CustomerJobsSomeSubFolder
If FTP1.RemotePath = CustomerJobsSomeSubFolder Then
CheckSwitchRemoteDir = True
Else
CheckSwitchRemoteDir = False
End If
ElseIf Err.Number = 0 Then 'Directory Exist
CheckSwitchRemoteDir = True
End If
End If
End Sub
'Listing Directory
Private Sub Command3_Click()
FTP1.ListDir
End Sub
'Removing Directory
Private Sub Command6_Click()
FTP1.RemoveDir CustomerJobsSomeSubFolder
End Sub
'Adding Folder Contents to Text1.text
Private Sub FTP1_Done(ByVal ErrorCode As Long, ByVal ErrorText As String)
Dim iLoop As Integer
'Some logic to make sure this only runs after ListDir...
If bListDir then
If FTP1.DirItems.Count > 0 Then
For iLoop = 0 To FTP1.DirItems.Count - 1
Text4.Text = Text4.Text & FTP1.DirItems(iLoop).name & vbCrLf
Next iLoop
End If
End If
End Sub
'*********************************************************
I have tried with Blocking on and off...
I have tried FTP1.Abort in between ListDir and RemoveDir...
I have also tried the same process in an off the shelf FTP client (CuteFTP Pro) and it works fine. Problem doesn't appear to be the server...
I only seem to get this error after I call ListDir...
Complete thread:
- Permission Denied After Calling ListDir - Roy, 2005-03-08, 20:28
- Re: Permission Denied After Calling ListDir - wodSupport, 2005-03-08, 20:44
- Re: Permission Denied After Calling ListDir - Roy, 2005-03-08, 21:30
- Re: Permission Denied After Calling ListDir - wodSupport, 2005-03-08, 21:32
- Re: Permission Denied After Calling ListDir - Roy, 2005-03-08, 21:43
- Re: Permission Denied After Calling ListDir - Roy, 2005-03-08, 21:44
- Re: Permission Denied After Calling ListDir - wodSupport, 2005-03-08, 21:52
- Re: Permission Denied After Calling ListDir - Roy, 2005-03-08, 21:56
- Re: Permission Denied After Calling ListDir - Roy, 2005-03-08, 21:57
- Re: Permission Denied After Calling ListDir - wodSupport, 2005-03-08, 22:01
- Re: Permission Denied After Calling ListDir - wodSupport, 2005-03-08, 22:36
- Re: Permission Denied After Calling ListDir - wodSupport, 2005-03-08, 22:01
- Re: Permission Denied After Calling ListDir - Roy, 2005-03-08, 21:57
- Re: Permission Denied After Calling ListDir - Roy, 2005-03-08, 21:56
- Re: Permission Denied After Calling ListDir - wodSupport, 2005-03-08, 21:52
- Re: Permission Denied After Calling ListDir - Roy, 2005-03-08, 21:44
- Re: Permission Denied After Calling ListDir - Roy, 2005-03-08, 21:43
- Re: Permission Denied After Calling ListDir - wodSupport, 2005-03-08, 21:32
- Re: Permission Denied After Calling ListDir - Roy, 2005-03-08, 21:30
- Re: Permission Denied After Calling ListDir - wodSupport, 2005-03-08, 20:44