Added simplistic flow control in transfer_file_data()