Frequently Asked Questions

How to download specific file type from server (txt files for example)?

After connection with server is establish. First you need to use in your code GetFiles Method. GetFiles Method fires LoopItemEvent. Actually LoopItemEvent fires before GetFiles begin downloading files. So you can decide what files you want to download in LoopItemEvent. 

Here is example for wodFtpDLX.NET. Example will download just txt files from some folder on server:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        dlx1 = New WeOnlyDo.Client.FtpDLX

        dlx1.Hostname = "your_hostname"
        dlx1.Login = "your_login"
        dlx1.Password = "your_password"
        dlx1.Connect ()
    End Sub

    Private Sub dlx1_ConnectedEvent(ByVal Sender As Object, ByVal Args As WeOnlyDo.Client.FtpConnectedArgs) Handles dlx1.ConnectedEvent
        dlx1.GetFiles("c:\weonlydo", "/home/something/weonlydo", 0) 
    End Sub

    Private Sub dlx1_LoopItemEvent(ByVal Sender As Object, ByVal Args As WeOnlyDo.Client.FtpLoopArgs) Handles dlx1.LoopItemEvent
        If Args.ItemType = WeOnlyDo.Client.DirItemTypes.Directory Then 
            Args.Skip = False
        Else
            If Args.RemoteFile.EndsWith(".txt") Then
                Args.Skip = False
            Else
                Args.Skip = True
            End If 
        End If
    End Sub


Here is example for wodFtpDLX ActiveX component (example is pretty same as example for wodFtpDLX.NET you need to use GetFiles Method and LoopItem Event just like in wodFtpDLX.NET):
Private Sub Form_Load()
Set dlx1 = New wodFtpDLXCom
    dlx1.Hostname = "your_hostname"
    dlx1.Login = "your_login"
    dlx1.Password = "your_password"
    dlx1.Connect
End Sub
Private Sub dlx1_Connected(ByVal ErrorCode As Long, ByVal ErrorText As String)

    dlx1.GetFiles "c:\test", "/home/kreso1/drazen", 0

End Sub

Private Sub dlx1_LoopItem(LocalFile As String, RemoteFile As String, ByVal ItemType As wodFtpDLXComLib.DirItemTypes, Skip As Boolean)
    If ItemType = typeDirectory Then
        Skip = False
    Else
         If Right$(RemoteFile, 4) = ".txt" Then
            Skip = False
         Else
            Skip = True
         End If
    End If
End Sub


 Last updated Fri, Nov 8 2013 12:00am

Please Wait!

Please wait... it will take a second!