Upload function and validation...