0

I would like to get the binary content of an image i uploaded using the UploadItem of SmartGWT but the UploadItem.getValue() method returns only the URL of the image. I looked through the API and there doesnt seem to be a method that can achieve what i require. Did i miss something? Does anyone have an idea?

4

1 回答 1

0

对我来说,你得到的行为是正常的,你得到的值是 formItem 的值,即输入的值,所以在你的情况下是图像的 url。要获取二进制内容,您需要使用正确的编码、正确的 http 方法设置表单并提交表单。在服务器端,您必须处理请求,发回图像内容。在 submitComplete 事件上返回客户端,您必须恢复响应中的图像内容。就我个人而言,我从不混合gwt小部件,smartgwt 除了上传(我真的不记得为什么......:))我使用 gwt 的地方FileUpload。希望它可以帮助

于 2013-03-20T11:28:11.913 回答