convert servlet schema to app-engine endpoint schema

こ雲淡風輕ζ 提交于 2019-12-01 17:52:21
Dan Holevoet

You can't currently use Endpoints as a callback to the blobstore blobstoreService.createUploadUrl. See this related answer. There is an open feature request for supporting mediaUpload, which would likely provide similar functionality to what you want. Feel free to star it to show support and get automatic updates.

What I'd recommend would be one of two possible alternatives, depending on the amount of data you are trying to upload.

If you're uploading small amounts of blob data, that would fit in the datastore, use the ShortBlob (up to 500 bytes) or Blob (up to 1 MB) type in your Endpoints entity class. Endpoints will handle serialization on the backend and will expect (and send back) base64-encoded strings via the client libraries. This is a very simple, straightforward approach.

If you want to provide blobs larger than 1 MB, for now, use the Google Cloud Storage JSON API. This API uses the same client library as Endpoints, so you don't have to worry about bundling another library with your application. This page has an example of inserting a blob into Google Cloud Storage with the Java client library.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!