add upload exception handler to server.php