简体   繁体   English

从Android获取Blobstore上传网址的语法是什么?

[英]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. 我有适用于GWT的Blobstore上传文件,但现在我需要我的Android应用程序才能上传到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 我看到了这篇文章,其中说明了获得URL后如何上传的方法,但并未显示获得URL的方法: 在Android应用程序中使用Google BlobStore

My questions are: 我的问题是:

  1. what URL do I send the get to? 我将get发送到哪个URL?
  2. what is the syntax of the get for blobstore? get for blobstore的语法是什么?

Thanks 谢谢

I have it like this: 我有这样的:

Widget.presenter.java: 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: ImageServiceImpl.java:

@Override
public String getBlobStoreUploadUrl() {
    //Map the UploadURL to the uploadservice which will be called by
    //submitting the FormPanel
    return blobstoreService.createUploadUrl("/imageUpload");
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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