2012-02-28 5 views
0

ダウンロードの進行状況を表示したい ドキュメントを読み込んでWebviewで表示したいと思います。ASIHTTPRequest、さらにAccurateProgressで0から1へのジャンプが進んでいます

すべてが機能していますが、進捗状況( - (void)setProgress:(float)newProgressメソッド)が4回表示され、値は0.000000と表示されます。

- (void)リクエスト:(ASIHTTPRequest *)リクエストdidReceiveBytes :(long long)バイトメソッドは、受信バイト1から元のサイズにジャンプします。

何が間違っていますか?

Serverは、私にレスポンスヘッダを送信します。

{ 
    "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:[email protected]"; 
    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]; 

いただきまし間違ったことではあっても、コンテンツの長さがアップ示されています!

答えて

0

同様の問題が発生しました。ダウンロードしているデータの容量はどれくらいですか?あなたはそれがどのように入ってきているかチェックしましたか? ASIHTTPRequestはヘッダーを正常にダウンロードするまで進捗状況のダウンロードを開始しません。データが2〜3回バーストで入るほど小さい場合、setProgressは0.0と1.0の値でのみ呼び出されます。

関連する問題