简体   繁体   中英

What is the syntax to get a Blobstore upload url from Android?

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:

  1. what URL do I send the get to?
  2. what is the syntax of the get for blobstore?

Thanks

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");
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM