[英]upload Image to blob-store
i have uploaded an image to blob-store by applying the example here 我已通过在此处应用示例将图片上传到Blob存储
https://developers.google.com/appengine/docs/java/blobstore/ https://developers.google.com/appengine/docs/java/blobstore/
and it worked just fine.. but when i removed the (index.jsp) file and used a formPanel and (com.google.gwt.user.client.ui.FileUpload) to upload my file it appeared on the datastore Viewer but couldn't see it on screen.help?? 并且它工作得很好..但是当我删除(index.jsp)文件并使用formPanel和(com.google.gwt.user.client.ui.FileUpload)上传我的文件时,它出现在数据存储查看器中,但无法在screen.help上看不到它?
another issue that if i want to view the uploaded image on another view of my project, how can i handle that.. I'm very new to web-application field and need alittle explanation please.. thanks . 另一个问题是,如果我想在项目的其他视图上查看上载的图像,我该如何处理..我对Web应用程序领域是个新手,请稍作解释..谢谢。
The FormPanel use an hidden iframe for send form request. FormPanel使用隐藏的iframe发送表单请求。
You can use a NamedFrame : 您可以使用NamedFrame:
String actionUrl = getActionURLFromServer();
NamedFrame frame = new NamedFrame("iframe");
frame.setSize("400px","600px");
final FormPanel form = new FormPanel(frame);
form.setEncoding(FormPanel.ENCODING_MULTIPART);
form.setMethod(FormPanel.METHOD_POST);
form.setAction(actionUrl);
FileUpload upload = new FileUpload();
upload.setName("myFile");
upload.addChangeHandler(new ChangeHandler() {
void onChange(ChangeEvent event) {
form.submit();
}
});
form.setWidget(upload);
RootPanel.get().add(form);
RootPanel.get().add(frame);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.