user2301515
user2301515

Reputation: 5107

Orbeon xforms and downloading a file

If i have a file instance in 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>

and also corresponding binds

<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>

How to do a downlowdable file from this:

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

How to do correctly a downlable file link?

Upvotes: 0

Views: 189

Answers (1)

Tester
Tester

Reputation: 36

maybe something like:

<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>

NB! xxforms:download

Upvotes: 2

Related Questions