diff --git a/gcloud/storage/blob.py b/gcloud/storage/blob.py index c8ced994f856..745ba1599d85 100644 --- a/gcloud/storage/blob.py +++ b/gcloud/storage/blob.py @@ -287,7 +287,13 @@ def download_to_file(self, file_obj, client=None): :raises: :class:`gcloud.exceptions.NotFound` """ client = self._require_client(client) - download_url = self.media_link + + if not self.media_link: + response = client.connection.api_request( + method='GET', path=self.path, _target_object=self) + download_url = response['media_link'] + else: + download_url = self.media_link # Use apitools 'Download' facility. download = Download.from_stream(file_obj)