Refactor upload method in Invoices controller