是否有可能使用AJAX Domino服务器上传的图像文件? [英] Is it possible to upload an image file using AJAX to Domino Server?

查看:87
本文介绍了是否有可能使用AJAX Domino服务器上传的图像文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以上传使用AJAX Domino服务器的映像文件?我想上传从Android手机中的照片。我可以在Domino中的图像数据发送回一个富文本字段。但我不知道如何呈现为Domino表单上的图像。理想情况下,我想送通过AJAX的照片,并将它连接到Domino文档到$文件字段。

Is it possible to upload an image file using AJAX to Domino Server? I am trying to upload a photo from Android phone. I can send the image data back to a rich text field in Domino. But I am not sure how to render it as an image on the Domino Form. Ideally I'd like to send the photo via ajax and have it attached to the Domino document as to a $File field.

这是差得远了唯一的例子是在这里: HTTP: //markwambler.blogspot.com/2009/10/webcam-snapshots-and-lotusdomino.html

The only example that is even close is here: http://markwambler.blogspot.com/2009/10/webcam-snapshots-and-lotusdomino.html

在此先感谢。我一直挣扎在这几天。

Thanks in advance. I have been struggling on this for days.

推荐答案

所以,如果你能够发送一个Base64的连接codeD版本的富文本字段,你想通过浏览器来显示它,那么你有一个两件事情要做。

So if you are able to send a Base64 encoded version to a rich text field and you want to display it via a browser then you have a couple of things to do.

  1. 确保您使用MIME创建文档。
  2. 创建为附件的MIME实体。
  3. 填充用的Base64串的MIME实体。
  4. 在德code到一个常规文件附件的文件。

这会给你,你可以创建一个URL链接到附件的常规Domino文档。

This will give you a regular Domino document with an attachment that you can create a URL and to link to.

这是本质的东西联系在一起的例子code在做什么。即:

This is essentially what the linked example code is doing. Namely:

session.ConvertMime=False
...
Set child = parent.CreateChildEntity()
Set header = child.CreateHeader("Content-Disposition")
Call header.SetHeaderVal({attachment; filename="} & fileName & {"})
...
Call child.SetContentFromText(stream, "image/jpeg", ENC_BASE64)
Call child.DecodeContent()

一旦保存文档则是微不足道安排一个链接到附件的URL的东西,如 db.nsf /视图名/ dockey / $文件/ filename.jpg 或把网址中的IMG SRC参数。

Once you have saved the document then it is trivial to arrange a link to the attachment url with something like db.nsf/viewname/dockey/$file/filename.jpg or put the url in an img src parameter.

没有一个设置与目前这是一个有点难以测试玩。我也怀疑它会更好,如果你可以模仿一个普通的文件上传的客户端。在这种情况下,你就不需要做手脚Base64和MIME与扩展1.3倍以上,使该线。

Not having a set up to play with at the moment it's a little difficult to test. I also suspect it would be better if you could mimic a regular file upload from the client. In that case you would not need to mess about with Base64 and MIME with the 1.3x expansion over the wire that gives.

这篇关于是否有可能使用AJAX Domino服务器上传的图像文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆