I might suggest getting a directory listing of files using glob (or some other mechanism) then looping through that list one at a time. Also, make sure to check for success or failure on your ftp commands, that will be a good indication. If you are using
, you should have everything you need.