Develop the upload funtion.