implement upload and download function

some details and user experience to be improved...