Hi Pat,

I have one that uses FTP extensively and it's pretty solid once you get it 
configured correctly.  The one thing that I don't see in your code below is an 
FTP_Login, which is required to establish the connection as it gives you the 
value in the "vFTP-ID" variable that you pass to the FTP_Receive.  Do you do 
that elsewhere in code not posted? 

Ed Glassgow
glass...@pcisys.net


On 4/20/18, 6:39 AM, "4D_Tech on behalf of Pat Bensky via 4D_Tech" 
<4d_tech-boun...@lists.4d.com on behalf of 4d_tech@lists.4d.com> wrote:

    Using v16.3 32-bit and 64-bit
    
    I'm trying to download some files via FTP.
    I get a list of the files in the specified directory:
    
    $error:=*FTP_GetDirList *(vFTP_ID;$hostpath;$atDldFileNames;$aiDldFileSizes;
    $aiDldFileKinds;$adDldFileDates;$aiDldFileTimes)
    (all arrays have been previously declared).
    No problem :)
    
    Then loop through the array of file names and hopefully download each one:
    
    *For *($i;1;*Size of array*($atDldFileNames))
    
    *If *($$aiDldFileKinds{$i}=1)
    
      // skip this dude
    
    *Else *
    
    $localFilePath:=$localPath+$atDldFileNames{$i} // eg: "Macintosh
    HD:Users:patbensky:clients:Anderson
    Vacations:images:10--MedicineTrailSnow.jpg"
    
    $filepath:=$hostpath+"/"+$atDldFileNames{$i} // eg:
    public_html/Anderson/uploads/10--MedicineTrailSnow.jpg
    
    $err:=*FTP_Receive *(vFTP_ID;$filepath;$localFilePath;0)
    
    // $err is always -1 or 10060 (file not found)
    
    *End for  *
    
    
    I've tried various different versions of the file pathnames but can't find
    one that works.
    
    For example:
    
    $hostpath:=$atDldFileNames{$i}
    
    localFilePath:=$localPath+"temp.jpg"
    
    .. and various other things.
    
    
    A/ny suggestions as to where I'm going wrong?
    
    
    Thanks!
    
    
    Pat
    
    
    
    -- 
    *************************************************
    CatBase - Top Dog in Data Publishing
    tel: +44 (0) 207 118 7889
    w: http://www.catbase.com
    skype: pat.bensky
    *************************************************
    **********************************************************************
    4D Internet Users Group (4D iNUG)
    FAQ:  http://lists.4d.com/faqnug.html
    Archive:  http://lists.4d.com/archives.html
    Options: https://lists.4d.com/mailman/options/4d_tech
    Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
    **********************************************************************


**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to