I want to save PNG content in the gae blobstore such that it can be served
with the URL provided by image.servingURL(). I'm successfully receiving the
content base64 encoded from javascript via a POST, but I'm unsure of the
process to convert the content such that it can be served by app engine.
Can you comment on my current strategy? Neither development nor production
servers are able to serve these blobs. Am I missing a step?
// load a reader with base64 encoded content from the ajax POST
lr := &io.LimitedReader{R: p, N: MAX_FILE_SIZE + 1}
// blobstore setup
context := appengine.NewContext(r)
w, err := blobstore.Create(context, fi.Type)
// create a base64 conversion pipe
var StdEncoding = base64.NewEncoding(encodeStd)
nr := base64.NewDecoder(StdEncoding, lr)
// now I think I have the original binary content
// use png.encode to create valid PNG bytes and drop the stream into the
blobstore
png.Encode(w, nr)
Thanks.
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/groups/opt_out.