【问题标题】:Orbeon xforms and downloading a fileOrbeon xforms 和下载文件
【发布时间】:2014-04-10 11:44:36
【问题描述】:

如果我在 Orbeon-xform 中有一个文件实例

<xforms:instance id="fileinst">
    <fileinst>
        <file>
            <name>file.txt</name>
            <type>text/plain</type>
            <data>YXNkZmFzZmFzZGY=</data><!--the file content-->
        </file>
    </fileinst>
</xforms:instance>

还有相应的绑定

<xforms:bind nodeset="instance('fileinst')/file">
    <xforms:bind nodeset="fail">
        <xforms:bind nodeset="name" type="xforms:string"/>
        <xforms:bind nodeset="type" type="xforms:string"/>
        <xforms:bind nodeset="data" type="xforms:base64Binary"/>
    </xforms:bind>
</xforms:bind>

如何从这里做一个可下载的文件:

<xforms:outpu ref="instance('fileinst')/file/data">
    <xforms:label>Download</xforms:label>
</xforms:outpu>

如何正确地做一个可下载的文件链接?

【问题讨论】:

    标签: orbeon xforms


    【解决方案1】:

    可能是这样的:

    <xforms:output ref="instance('fileinst')/file/data" appearance="xxforms:download">
      <xforms:filename ref="instance('fileinst')/file/@name" />
      <xforms:mediatype ref="instance('fileinst')/file/@type" />
      <xforms:label>Download</xforms:label>
    </xforms:output>
    

    注意! xxforms:下载

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-11-02
      • 2019-02-11
      • 1970-01-01
      • 1970-01-01
      • 2019-04-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多