Hi Guys,
Im trying to upload images using the new Blobstore API to the app
engine with GWT.
Ive created a FormPanel() to upload the images to the app engine, but
when im trying to set up the action in the form using
BlobstoreService, i cant because the import com.google.appengine
cannot be resolved.
My question is: how can I set up the action on the form using the
BlobstoreService?? I've this code in the client side:
import com.google.appengine.api.blobstore.BlobstoreService;
FormPanel form = new FormPanel();
form.setEncoding(FormPanel.ENCODING_MULTIPART);
form.setMethod(FormPanel.METHOD_POST);
BlobstoreService blobstoreService =
BlobstoreServiceFactory.getBlobstoreService();
form.setAction(blobstoreService.createUploadUrl("handizo/
upload"));
error: import com.google.appengine cannot be resolved.
Ive also tried to setup the action without the BlobstoreService, but
when the form is read in the server side using the BlobstoreService:
private BlobstoreService blobstoreService =
BlobstoreServiceFactory.getBlobstoreService();
protected void doPost(HttpServletRequest req, HttpServletResponse
resp)
throws ServletException, IOException {
Map<String, BlobKey> blobs =
blobstoreService.getUploadedBlobs(req);
BlobKey blobKey = blobs.get("myFile");
if (blobKey == null) {
resp.sendRedirect("/");
} else {
resp.sendRedirect("/serve?blob-key=" +
blobKey.getKeyString());
}
I've this other error saying me that I've to set up the action using
the BlobstoreService.
Error: Must be called from a blob upload callback request.
at
com.google.appengine.api.blobstore.BlobstoreServiceImpl.getUploadedBlobs
(BlobstoreServiceImpl.java:97)
at com.handizo.server.service.FileUploadAnnouncementServlet.doPost
(FileUploadAnnouncementServlet.java:23)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
So its possible to user the BlobstoreService with GWT by the moment??
Thanks in advance :-)
--
You received this message because you are subscribed to the Google Groups
"Google App Engine for Java" 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-java?hl=en.