I looked at the code, did a bunch of test transfers, and added a little debugging code.
When you are transferring a file using an FTP client, say from a PC to a device, the area of code that deals with transfer is the STOR command. In TinyFTPSvr.bas the code is between lines numbered 447 to 493.
When new data is received from the PC the event AdataStm_NewData() is fired. This subroutine just copies the data bytes from the input stream (FTP socket connected to the PC client) to the output stream (file on the device).
I added some debug code to count the number of bytes transferred.
I transferred several files, small PNG images to a 208 MB movie file. I then compared the number of bytes transferred (this will be displayed in the B4A Log window similar to what's shown below) with the actual file size reported by the PC (note: you must right-click the file, select properties, and then view the actual number of data bytes in the file. See the image attached to this post).
Data Socket Connected
STOR debug buffer xfers
STOR buffer total=213750831
In all my tests the correct number of data bytes were transferred. I copied the files back to the PC using a different, third-party FTP server. The files were identical to the original files on the PC.
You may want to try the same test. Run my demo compiled in debug mode. Copy files from the PC to your device using Tiny FTP. Verify that the actual file size on the PC matches the number of bytes copied as shown in the log “STOR buffer total=xxx”. Copy the files back from your device to the PC using some other method (different FTP, ADB, USB,…) to a junk directory and verify that the files are identical to the original PC files.
Barry.
