Posts by Rich Laver

    Dear Friends


    I am attempting to download data from an FTP server using VB; however the cFileName attribute of the WIN32_FIND_DATA structure returned by calling the FtpFindFirstFile function is returning only the final few characters of the filename. This prevents me from using the FtpGetFile function to download the file.


    The number of characters it returns is anywhere from two to eight. For instance, if the filename is filename.xlsx, the cFileName attribute — after trimming nulls — might give sx or ame.xlsx


    I have already spent quite a few weeks trying to crack this, including an extensive online search and trialling using different computers but to no avail. I am using a 64-bit Windows 10 Pro operating system.


    I have copied the simplest version of the code below, with the connection details obscured for sensitivity. Would anyone be able to help me please?


    Best




    Rich