checking up on blobstore

8 views
Skip to first unread message

pgio

unread,
Aug 15, 2010, 9:20:33 PM8/15/10
to appenginejs
Hey George, just wondering if there's a fix for the blobstore
redirects yet. I pulled and built the latest ringo and installed the
latest appengine stuff; up and running, same redirect error. So I'm
guessing the jsgi-skip-response doesn't work.

Thanks,
Pete

George Moschovitis

unread,
Aug 16, 2010, 2:19:03 AM8/16/10
to appen...@googlegroups.com
i think it is fixed... have a look at the latest appengine-blog-example, it works correctly with me...
are you sure you have run:

ant jar

after you pulled the latest Ringo?

-g.
--
http://www.gmosx.com/blog
http://www.appenginejs.org

pgio

unread,
Aug 16, 2010, 1:22:29 PM8/16/10
to appenginejs
Yeah; pulled the source for Ringo, ran

ant jar

installed the latest appengine

ringo-admin install gmosx/appengine

made a new appengine app

ringo-admin create --appengine

copied the proper stuff in. As I said, up and running! But I still get
the error 500 when trying to access the blobstore. Offending code:

exports.save = function save(req) {
var blob = blobstore.getUploadedBlobs(req);
var location = "/serve?key=" + blob.file.toString();
return {
status: 303,
headers: {"Location": location}
}
}

which looks the same as what's in the latest appengine-blog example
(which you're right, works fine.)
Since you're using Nitro in the blog example, does this suggeset a
Ringo problem?

Thanks,
Pete

George Moschovitis

unread,
Aug 17, 2010, 9:11:44 AM8/17/10
to appen...@googlegroups.com
I am not sure what the problem really is...send me your app, and I 'll have a look.

-g.

On Mon, Aug 16, 2010 at 8:22 PM, pgio <pete.gi...@gmail.com> wrote:
Yeah; pulled the source for Ringo, ran

ant jar

installed the latest appengine

ringo-admin install gmosx/appengine

made a new appengine app

ringo-admin create --appengi
copied the proper stuff in. As I said, up and running! But I still get
the error 500 when trying to access the blobstore. Offending code:

exports.save = function save(req) {
       var blob = blobstore.getUploadedBlobs(req);
       var location = "/serve?key=" + blob.file.toString();
   return {
       status: 303,
       headers: {"Location": location}
   }
}

which looks the same as what's in the latest appengine-blog example
(which you're right, works fine.)
Since you're using Nitro in the blog example, does this suggeset a
Ringo problem?

Thanks,
Pete

George Moschovitis

unread,
Aug 18, 2010, 12:57:20 PM8/18/10
to appenginejs, pete.gi...@gmail.com, han...@gmail.com
You should change the code to:

exports.save = function save(req) {
var blob = blobstore.getUploadedBlobs(req);
var location = "/serve?key=" + blob.image.toString();
return {
status: 303,
headers: {"Location": location},
body: []
}
}

ie, use blob.image instead of blob.file (because you named the file
input image in your html).

this should work, but Ringo complains with 'No valid JSGI response', I
am not sure why.

Perhaps Hannes could help here...

-g.

pgio

unread,
Aug 21, 2010, 10:45:25 PM8/21/10
to appenginejs
At least it advances by one step to the /serve url...

pgio

unread,
Aug 21, 2010, 11:23:19 PM8/21/10
to appenginejs
If I amend the serve function so:


exports.serve = function (req, key) {
if (key){
return blobstore.serve(key, req);
}
return redirectResponse("/home");

}

adding a redirectResponse to the negative path, it seems to all work.
Stuff gets stored in the blobstore, the app doesn't blow up. My code
for adding a user at that point doesn't work, but that is my fault of
course!

pgio

unread,
Aug 23, 2010, 1:44:17 PM8/23/10
to appenginejs
Spoke too soon -- /serve is always taking the negative path it seems.
Reply all
Reply to author
Forward
0 new messages