问题
I have Blobstore uploads working for GWT, but now I need my Android app to upload to Blobstore. I saw this post which explains how to upload once I have the URL, but it does not show getting the URL: Using Google BlobStore with an Android application
My questions are:
- what URL do I send the get to?
- what is the syntax of the get for blobstore?
Thanks
回答1:
I have it like this:
Widget.presenter.java:
uploadButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
//init action
imageService.getBlobStoreUploadUrl(new AsyncCallback<String>() {
@Override
public void onFailure(Throwable caught) {
Window.alert("Oups Error at ImageUploaderPresenter");
}
@Override
public void onSuccess(String result) {
uploadForm.setActionUpload(result);
uploadForm.submit();
}
}
});
}
ImageServiceImpl.java:
@Override
public String getBlobStoreUploadUrl() {
//Map the UploadURL to the uploadservice which will be called by
//submitting the FormPanel
return blobstoreService.createUploadUrl("/imageUpload");
}
来源:https://stackoverflow.com/questions/8165993/what-is-the-syntax-to-get-a-blobstore-upload-url-from-android