upload and download code written but wont work at the same time