sharing utilities between upload and download files