Added option to choose upload method