Main Content

Magnolia Community Forums: Get help with Magnolia: Get link to a file in binary data


  • Mrye
    Mrye
    Full name: Yousoff Effendy
    Posts: 16
    Last post: May 31, 2017 12:07:51 PM
    Registered on: Sep 5, 2016
    Get link to a file in binary data
    #1 by Mrye on May 31, 2017 11:21:52 AM

    I've uploaded my PDF file using DamUploadFieldDefinition. It seems like it is stored under node based on binaryNodeName.

    How can I get the link to that file so that the public user can download it ?

  • will
    will
    Full name: Will Scheidegger
    Posts: 424
    Last post: May 31, 2017 11:30:01 AM
    Re: Get link to a file in binary data
    #2 by will on May 31, 2017 11:30:01 AM

    Have a look at https://documentation.magnolia-cms.com/display/DOCS/cmsfn#cmsfn-Links

  • Mrye
    Mrye
    Full name: Yousoff Effendy
    Posts: 16
    Last post: May 31, 2017 12:07:51 PM
    Registered on: Sep 5, 2016
    Re: Get link to a file in binary data
    #3 by Mrye on May 31, 2017 12:07:51 PM

    I get a link, and I get error 404 when I open with that link.

    My ftl :

    [#assign binaryNode = cmsfn.nodeByPath("binaryNodePath", "workspace")]
    [#assign link = cmsfn.link(binaryNode)]
    ${link!}

    Output :
    <context-path>/../jcr:content/TEMPORARY.pdf

  • iokerhe1
    iokerhe1
    Full name: Francisco J. Giner
    Posts: 8
    Last post: Jul 12, 2017 10:46:55 AM
    Registered on: Aug 28, 2015
    Re: Get link to a file in binary data
    #4 by iokerhe1 on Jun 8, 2017 2:02:43 PM

    You need to use damfn, not cmsfn:

    https://documentation.magnolia-cms.com/display/DOCS/damfn#damfn-Getlinkforasset

You don't have the permission to post on this thread

Sign in

To login on this forum, you can use your Magnolia Forge, Support or Partner account, or, below, your Google, Yahoo! or OpenID account. If you have trouble logging in, or any other sort of issue, please let us know in the Meta forum, on the user-list, or simply by email at forum-admin at magnolia-cms dot com.

* Required

... or sign in with:

  • icon http://{your-openid-url}
  • icon
  • icon https://me.yahoo.com/