memory efficient way to upload