Я хочу показать прогресс от загрузки.
Я хочу загрузить документ и показать его в веб-представлении.
Все работает, только мой прогресс (метод - (void) setProgress: (float) newProgress) отображается 4 раза и сообщает значение: 0,000000.
Даже запрос - (void): запрос (ASIHTTPRequest *) didReceiveBytes: метод байтов (long long) переходит от полученных байтов 1 к исходному размеру.
Что я делаю не так?
Сервер отправляет мне заголовок ответа:
{
"Cache-Control" = "private,max-age=0";
"Content-Length" = 22993;
"Content-Type" = "application/vnd.ms-word.document.12";
Date = "Tue, 28 Feb 2012 12:20:18 GMT";
Etag = "\"{EA1043C4-BE59-4775-AAC0-D25141572D94},2\"";
Expires = "Mon, 13 Feb 2012 12:20:18 GMT";
"Last-Modified" = "Wed, 13 Apr 2011 11:04:06 GMT";
MicrosoftSharePointTeamServices = "14.0.0.4762";
"Persistent-Auth" = true;
"Public-Extension" = "http://schemas.microsoft.com/repl-2";
ResourceTag = "rt:EA1043C4-BE59-4775-AAC0-D25141572D94@00000000002";
SPRequestGuid = "e4791157-4b6f-4961-84e1-2979d23bf5bc";
Server = "Microsoft-IIS/7.5";
"Set-Cookie" = "WSS_KeepSessionAuthenticated={d2e7fd96-aad9-429d-b85d-64a13026c693}; path=/, WSS_KeepSessionAuthenticated={d2e7fd96-aad9-429d-b85d-64a13026c693}; path=/, WSS_KeepSessionAuthenticated={d2e7fd96-aad9-429d-b85d-64a13026c693}; path=/";
"X-Content-Type-Options" = nosniff;
"X-Powered-By" = "ASP.NET";
"X-SharePointHealthScore" = 0;
}
ASIHTTPRequest *asiRequestTemp = [ASIHTTPRequest requestWithURL:[NSURL URLWithString: self.documentURL]];
[asiRequestTemp setTimeOutSeconds:10];
[self setAsiRequestDocumentViewer:asiRequestTemp];
[asiRequestDocumentViewer setDelegate:self];
[asiRequestDocumentViewer setUseKeychainPersistence:YES];
[asiRequestDocumentViewer setUseSessionPersistence:YES];
[asiRequestDocumentViewer setShowAccurateProgress:YES];
[asiRequestDocumentViewer setDownloadProgressDelegate:self];
[asiRequestDocumentViewer setDownloadDestinationPath:mediaPath];
[asiRequestDocumentViewer startAsynchronous];
Что в этом плохого, даже отображается длина контента!