int start=0,flag=1;
long size=blobInfo.getSize(),fetched=0,fetch;
byte temp[] = null;
while(fetched<size){
if(size-fetched>MAX_BLOB_FETCH_SIZE)
fetch=MAX_BLOB_FETCH_SIZE;
else
fetch=size-fetched;
temp=blobstoreService.fetchData(blobKey,fetched,fetch);
fetched+=fetch;
out.println(temp);
}
我試圖使用上面的代碼打印上傳的文本文件的數據,但它似乎並沒有工作。無法打印上傳的blob數據
。告訴我們你如何獲得上傳的項目。 – Bozho 2010-04-15 08:32:58
你爲什麼試圖通過你的代碼獲取並顯示blob? blobstore背後的想法是,您可以直接向用戶提供服務 - 詳細信息請參閱文檔。 – 2010-04-15 09:44:09
@Bohzo temp = blobstoreService.fetchData(blobKey,fetched,fetch);代碼中的 行將上傳項目的一部分作爲字節數組提取,稱爲獲取數據。 – 2010-04-15 10:01:50