Skip to main content

Posts

Showing posts from October, 2016

FtpGetFile bug and resolution

I was using FtpGetFile in some VBA to download some files from an FTP server but I was losing data from the end of the files. Downloading the same files with an FTP client got the complete files - no problem. The files concerned got onto the server via some PHP on a web server that opened a file for append , wrote some data, closed it and  sometime later did it again (and again) like this: $myfile = fopen("Afile.txt", "a") or die("Unable to open file!"); fwrite($myfile, $stuff1."\r\n"); fwrite($myfile, $stuff2."\r\n"); ... fwrite($myfile, "stuffN"."\r\n"); fclose($myfile);   (up to an hour passes)   $myfile = fopen("Afile.txt", "a") or die("Unable to open file!"); fwrite($myfile, $stuff11 ."\r\n"); fwrite($myfile, $stuff12."\r\n"); ... fclose($myfile); I noticed that the incomplete files always had complete sessions/records - just not enough of them while th...