Fixed data corruption bug in ftp_upload script