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/dcd5842e-3a49-4eed-bf8a-69c9916a1884%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.