1
NSURLConnection의 didReceiveData에서 콜백을 받거나 Google 드라이브 파일을 다운로드 할 때 다운로드 진행률을 추적하는 다른 방법이 있습니까?다운로드 진행률 얻기 Google 드라이브
나는 오직 하나만 uploadProgress 파일을 볼 수 있으며 다운로드 방법은 완료 블록을 사용합니다.
NSURLConnection의 didReceiveData에서 콜백을 받거나 Google 드라이브 파일을 다운로드 할 때 다운로드 진행률을 추적하는 다른 방법이 있습니까?다운로드 진행률 얻기 Google 드라이브
나는 오직 하나만 uploadProgress 파일을 볼 수 있으며 다운로드 방법은 완료 블록을 사용합니다.
여기 당신을위한 코드입니다 :
self.fetcher = [GTMHTTPFetcher fetcherWithRequest:request];
[self.fetcher setReceivedDataBlock:^(NSData *data) {
float percentTransfered = self.fetcher.downloadedLength * 100.0f/self.fetcher.response.expectedContentLength;
// Do something with progress
}
expectedContentLength 반환 -1 다운로드 한 파일의 크기를 알 수없는 경우.