I haven't tried this, but...the BlobstoreService.serve() method takes a
javax.servlet.http.HttpServletResponse instance as a parameter. My guess is
that BlobstoreService.serve() simply invokes
HttpServletResponse.getOutputStream() and then writes the data to the output
stream. You could create your own implementation of the HttpServletResponse
interface that simply writes the output to a byte array
(java.io.ByteArrayOutputStream). You could then retrieve the byte array and
do whatever is needed to send it as an attachment. Something like this:

   ByteArrayHttpServletResponse response = new
ByteArrayHttpServletResponse();
   BlobstoreService.serve( myBlobKey, response );
   byte[] data = response.toByteArray();

Attached is a quick-and-dirty skeleton for ByteArrayHttpServletResponse that
should get you started.

Vince

On Sun, Jan 3, 2010 at 2:32 AM, Aadith <[email protected]> wrote:

> Hi,
> I am trying to design an application that would require me to retrieve
> data stored in blobstore and send it as attachment. Does google app
> engine allow this?  From the documentation, i could not find a way to
> retrieve data from blobstore for processing within the app.. can
> someone please tell me how to accomplish this? Code examples and/or
> pointers to related online resources would be really helpful.
>
> Thanks,
> Aadith
>
>
--
You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.

Attachment: ByteArrayHttpServletResponse.java
Description: Binary data

Reply via email to