Upload dat to server in a loop