saprouzy Posted July 8, 2005 Posted July 8, 2005 hello there,am trying to import some files to a local direcotry from an ftp serveram using the following codeconn is an INet controli added the lcd command because i noticed that on ftp (run from command prompt) the mget puts the files in the directory where ftp was run from, so when i change the local current directory it will put them there.but my code isn't working. if anyone can test it and try to figure out what's wrong with it. thanksps: i know there are api functions for ftp commands, but i prefer using Inet.Private Sub cmd_ImportFiles_Click()conn.URL = "ftp://user:password@192.168.0.1"Me.StatusBar.SimpleText = "Connected to Ftp."ftp_src_dir = "Alfa/Beta/"ftp_dest_dir = App.Pathconn.Execute conn.URL, "lcd " & ftp_dest_dirWhile conn.StillExecuting: DoEvents: Wendconn.Execute conn.URL, "MGET " & ftp_src_dir & "*"While conn.StillExecuting: DoEvents: WendMsgBox "end"End Sub
saprouzy Posted July 9, 2005 Author Posted July 9, 2005 i replaced it with conn.Execute conn.URL, "CD " & ftp_src_dir While conn.StillExecuting: DoEvents: Wend conn.Execute conn.URL, "DIR " While conn.StillExecuting: DoEvents: Wend zFileList = conn.GetChunk(4096, 0) zFiles = Split(zFileList, vbCrLf) i = 0 While (i < UBound(zFiles) - 1) conn.Execute conn.URL, "GET " & zFiles(i) & " " & ftp_dest_dir & "\"& zFiles(i) wendit actually suits me better for my prog, but still it would be insteresting to know how to MGET the files
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now