Refactored controller upload method