如何使用xpage中的链接打开附件? [英] How to open an attachment using a link in an xpage?
问题描述
如何使用链接网址在xpage中打开附件? url的所有字段是什么?请解释一下。还有关于在'xsppers'文件夹中创建的文档文件夹。 解决方案
简短的回答如何打开附加的图片是: / p>
http://pathToyourDatabase/DatabaseName.nsf/0/DocumentUniversalID/$File/MyImage.jpg
您可以创建此链接:
<$ c在我的情况下:viewEntry.getDocument()。getUniversalID()* / $ b $ var $ image / image / getContextPath()// 0 /+ $ b $ / * / var imageurl = facesContext.getExternalContext()。getRequest b +/ $ File /+ AttachmentName;
将此链接放在 src
属性中< img>
或< xp:image>的
标签会将这个图像放在您的x页面上。这个例子适用于我,但是对于其他附件,你必须在附件名称之后添加 url
?OpenElement
Update:
我用pdf文件做了一个简短的实验,它没有使用?OpenElement
只是使用代码来生成它应该工作的网址。另外你可以看看@ 链接。
How to open an attachment in an xpage using a link url? What are all the fields iln the url? Pls explain. Also about the document folder created in the 'xsppers' folder.
The short answer how to open a attached Image is:
http://pathToyourDatabase/DatabaseName.nsf/0/DocumentUniversalID/$File/MyImage.jpg
you can create this link with:
var imageurl = facesContext.getExternalContext().getRequest().getContextPath() + "/0/" +
/*in my case: viewEntry.getDocument().getUniversalID()*/
+ "/$File/"+ AttachmentName;
placing this link in the src
attribute of an <img>
or in the url
attribute of the <xp:image>
tag will dislay this image on your xPage. This example works fine for me but for other Attachments you maby have to add ?OpenElement
after the AttachmentName.
Update:
I did a short experiment on this with a pdf file and it worked without the ?OpenElement
just use the code to generate the url it should work. Additional you can look @ Link.
这篇关于如何使用xpage中的链接打开附件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!