[google-appengine] Re: Don't Understand Blobstore limits

2011-04-03 Thread Yonatan Maman
I'm trying to use the new File/Blob API which was released in the
1.4.3 version.
I have no problem storing files  1MB.
for larger files I'm splitting the writting into smaller chunks of
800KB

private void putInBlobstore(String mt, byte[] data) throws Throwable {
 final FileService fileService =
FileServiceFactory.getFileService();
 final AppEngineFile file = fileService.createNewBlobFile(mt);
 final FileWriteChannel writeChannel =
fileService.openWriteChannel(file, true);
 int pos = 0;
 final long dataLen = data.length;
 while (pos  dataLen) {
final int hm = (int) Math.min(dataLen - pos, 80);
final int actual = writeChannel.write(ByteBuffer.wrap(data, pos,
hm));
pos += actual;
 }
 writeChannel.closeFinally();
}

but it didn't work :-( I also tried to create different files for each
of the chunks (i.e. put file, and writeChannler creation inside the
loop),

private void putInBlobstore(String mt, byte[] data) throws Throwable {
 int pos = 0;
 final long dataLen = data.length;
 while (pos  dataLen) {
final FileService fileService =
FileServiceFactory.getFileService();
final AppEngineFile file = fileService.createNewBlobFile(mt);
final FileWriteChannel writeChannel =
fileService.openWriteChannel(file, true);
final int hm = (int) Math.min(dataLen - pos, 80);
final int actual = writeChannel.write(ByteBuffer.wrap(data, pos,
hm));
pos += actual;
 }
 writeChannel.closeFinally();
}
but it didn't work as well :-(
Can you please elaborate the term 1MB per API call which API ?
Thanks in advance -- Yonatan


On Apr 2, 7:38 pm, Movesax move...@gmail.com wrote:
 thanks very much, you've both cleared things up for me.

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.



[google-appengine] Re: Don't Understand Blobstore limits

2011-04-02 Thread Movesax
thanks very much, you've both cleared things up for me.

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.



[google-appengine] Re: Don't Understand Blobstore limits

2011-04-01 Thread Mahron
The limitation only applies if you read or write directly from the
blob in your code.

with

blobstore_handlers.BlobstoreUploadHandler

blobstore_handlers.BlobstoreDownloadHandler

you can upload and download files up to 2GB in one peace.

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.