getting files with getfiles method - WeOnlyDo Discussion board

getting files with getfiles method (wodFtpDLX / wodFtpDLX.NET)

by Scot, Tuesday, January 21, 2014, 19:33 (3959 days ago) @ wodDrazen

well the done event will fire each time a function is executed
like connect, getfiles, etc
in this section below (it's on the connected event)
i want to get everything, of a certain naming convention
and, then delete those specific files that I pulled
but... i'm using the loopitem to try and trap the filenames that were pulled
and, it doesn't seem to be saving them off
every time, my nbr_ftp_files is just 1
even though I'm incrementing it in the loopitem event


connected
----------

nbr_ftp_files = 1

in_dir = capp_directory + 'jpmc\import\'
out_dir = '/Outbound/Encrypted/'
ole_ftp.object.getfiles(in_dir, out_dir )

for i = 1 to nbr_ftp_files
ole_ftp.object.deletefile(file_array )
next


f_list = capp_directory + '\jpmc\import\DOCCTS.EFS.ACK2*'
lb_filelist.dirlist(f_list, 0)
if lb_filelist.totalitems() < 1 then
messagebox('JPMC Upload', 'There are No files to Upload')
else
st_files.text = string(lb_filelist.totalitems())
if messagebox('JPMC Files','Do you wish to Proceed with the Processing of the files', Question!, YesNo!) = 2 then
else
for i = 1 to lb_filelist.totalitems()
process_files(lb_filelist.text(i))
next
end if
end if

ole_ftp.object.disconnect(true)
pb_update.enabled = true
pb_ok.enabled = false


loopitem
-------
if (match(remotefile,'DOCCTS.EFS.ACK2') = true) then
file_array[nbr_ftp_files] = remotefile
nbr_ftp_files = nbr_ftp_files + 1
messagebox('error',string(nbr_ftp_files))
Skip = false
else
messagebox('error','skip')
skip = true
end if


Complete thread: