Hi Seth,
Uploading a filetype not-supported by the images API raises a more
generic exception. Uploading a file that is too large raises a
RequestTooLargeError. The following test code works fine for me:
class WriteBlobhandler(webapp.RequestHandler):
def post(self):
file_name = files.blobstore.create(mime_type='image/jpeg')
# upload something large and you'll get an error.
content = self.request.get('file')
with files.open(file_name, 'a') as f:
f.write(content)
files.finalize(file_name)
blob_key = files.blobstore.get_blob_key(file_name)
# upload an unsupported image type and you'll get an error.
serving_url = get_serving_url(str(blob_key))
self.redirect(serving_url, 500)
Maybe you were just seeing transient errors?
Robert
On Thu, Apr 14, 2011 at 03:25, Seth Nickell <[email protected]> wrote:
> I'm trying to call images.get_serving_url() on a blob I just created using
> the (experimental) blobstore write features. Its raising an anonymous error,
> and was 10 hours ago too. The underlying API error is
> ImagesServiceError.UNSPECIFIED_ERROR. Everything works great on the local
> dev server.
> Here's what I'm doing:
>
> file_name = files.blobstore.create(mime_type="images/jpeg",
>
> _blobinfo_uploaded_filename=local_filename)
>
> with files.open(file_name, 'a') as f:
> f.write(my_image_blob)
> files.finalize(file_name)
> blob_key = files.blobstore.get_blob_key(file_name)
> serving_url = my_get_serving_url(blob_key) # ERROR
>
> -Seth
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" 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?hl=en.
>
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" 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?hl=en.