To try to estimate the problem, you can post lines with key functions only, like FtpGetFile / HttpOpenRequest / maybe callback routine + declarations of functions and used constants.
work fine for Downloading but not Uploading as far as extracting the Bytes that are being move.
Not quite understandable, if the problem occurs during downloading (FtpGetFile) or in some other function for uploading ...