better code for upload_from_remote_url