[AccessD] Transferring Files via FTP

Stuart McLachlan stuart at lexacorp.com.pg
Fri Oct 9 04:39:58 CDT 2020


Probaby the easiest solution is to downlad WinSCP and use it in commandline mode with a 
script simiar to using FTP.exe

See
https://winscp.net/eng/docs/scripting

On 9 Oct 2020 at 19:25, Stuart McLachlan wrote:

> PING is not  a protocol that uses authentication.
> 
> But wgat's worse, Windows FTP.exe doesn't work wth SFTP.
> 
> 
> On 9 Oct 2020 at 21:31, David Emerson wrote:
> 
> > I can't find any ping commands that accept the credentials.
> > 
> > I get the same problem when I try getting a list of files using this
> > function:
> > 
> > Function ListFTPFiles(strFTPLogin As String, strFTPPassword As
> > String, strDirectory As String) As Variant
> > 
> >     On Error GoTo Err_ListFTPFiles
> > 
> >     Const q As String * 1 = """"
> > 
> >     Dim sEXE As String, strList As String, strFiles() As String, x
> >     As Long,
> > ff As Long
> > 
> >     strList = TempDir() & "FTPCmds.tmp"
> >     ff = FreeFile
> > 
> >     Open strList For Output As #ff
> >     Print #ff, "open " & Nz(basCustomDLookUp("FTPSiteAddress",
> > "dbo.tlkpSystemSetting", "SYID = 1"), "")
> >     Print #ff, strFTPLogin
> >     Print #ff, strFTPPassword
> >     Print #ff, "cd " & strDirectory
> >     Print #ff, "ls . " & TempDir() & "webfiles.txt"
> >     Print #ff, "bye"
> >     Close #ff
> > 
> >     sEXE = Environ$("COMSPEC")
> >     sEXE = Left$(sEXE, Len(sEXE) - Len(Dir(sEXE)))
> >     sEXE = sEXE & "ftp.exe -s:" & q & strList & q
> >     ShellWait sEXE, vbHide
> > '    Kill strList
> >     ff = FreeFile
> >     Open TempDir() & "webfiles.txt" For Input As #ff
> >     While Not EOF(ff)
> >         x = x + 1
> >         ReDim Preserve strFiles(x)
> >         Line Input #1, strFiles(x)
> >     Wend
> >     Close #ff
> >     'Kill TempDir() & "webfiles.txt"
> >     ListFTPFiles = strFiles()
> > 
> > The webfiles.txt file is not being created.  The strDirectory
> > ("EIEPin ") exists and is off the root directory.  It also has files
> > in it.
> > 
> > Do I need to send the port number through?  It should be 22.
> > 
> > David
> > 
> > -----Original Message-----
> > From: AccessD <accessd-bounces at databaseadvisors.com> On Behalf Of
> > Gustav Brock via AccessD Sent: Friday, 9 October 2020 9:19 pm To:
> > Access Developers discussion and problem solving
> > <accessd at databaseadvisors.com> Cc: Gustav Brock <gustav at cactus.dk>
> > Subject: Re: [AccessD] Transferring Files via FTP
> > 
> > Hi David
> > 
> > > I am able to connect using FileZilla.  But this includes a login
> > > and
> > password.
> > 
> > I guess you still need to pass your credentials.
> > 
> > /gustav 
> > 
> > -- 
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > http://databaseadvisors.com/mailman/listinfo/accessd
> > Website: http://www.databaseadvisors.com
> > 
> > -- 
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > http://databaseadvisors.com/mailman/listinfo/accessd
> > Website: http://www.databaseadvisors.com
> > 
> 
> 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 




More information about the AccessD mailing list