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