java.lang.IllegalArgumentException: INVALID_BLOB_KEY: Could not read blob.
at
com.google.appengine.api.images.ImagesServiceImpl.getServingUrl(ImagesServiceImpl.java:282)
"
As my 3 projects experience, this error occurs on the local dev server
only. It will return a success serving URL on the production server.
Hope this could help.
On Saturday, July 1, 2017 at 10:16:25 PM UTC+7, bk aaron wrote:
>
> am getting the same error "java.lang.IllegalArgumentException:
> INVALID_BLOB_KEY: Could not read blob.
> at
> com.google.appengine.api.images.ImagesServiceImpl.getServingUrl(ImagesServiceImpl.java:282)
> "
>
> i want to return the image url
> here's the code
>
> public List<String> blobstore_method(HttpServletRequest request) throws
> IOException{
> Map<String, List<BlobKey>> blobs = blobstoreService.getUploads(request);
> List<BlobKey> blobKeys = blobs.get("myFile");
> image_urls = null;
>
> if (blobKeys == null || blobKeys.isEmpty()) {
> response.sendRedirect("/");
> } else {
> response.sendRedirect("/notice.jsp");
> System.out.println("submited");
> }
> for(BlobKey obj : blobKeys){
> obj.getKeyString();
> //blobstore image
> com.google.appengine.api.images.ImagesService services =
> ImagesServiceFactory.getImagesService();
> ServingUrlOptions serve =
> ServingUrlOptions.Builder.withGoogleStorageFileName("/gs/"+obj.getKeyString());
>
> // Blobkey of the image uploaded to BlobStore.
> image_urls.add(services.getServingUrl(serve));
> }
> return image_urls;
> }
>
>
--
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 https://groups.google.com/group/google-appengine.
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-appengine/b866d25d-5a10-4f6a-be44-fabf50a9e795%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.