Added sanity checking in send_file_data()