0

I have a spreadsheet uploaded via Mura's file manager. I need to read that file using ColdFusion and for that I need a query object returned via the read() method of Mura's file manager bean. In order to call the read() method I will need the fileID. The problem is I don't have that. I have the filename and it will always be the same. I can't use $.content because the file wasn't uploaded to the current page. Any ideas?

Basically any ideas about how can I use this

<cfset file = #$.getBean('filemanager').readMeta(item.getFileID()).filename#>

That code does not work for me because it refers to item.getFileID and as I am not in a loop I am unable to use it.

Miguel-F
  • 13,450
  • 6
  • 38
  • 63
user2067888
  • 1,085
  • 3
  • 11
  • 17

1 Answers1

0

Since you know the Mura content node that holds the file will always have the same name, you can load the content bean based on that name.

bean = $.getBean("content").loadBy(name={name}, siteID={siteID})

(siteid is optional)

If there are more content nodes with the same name, the call loadby function will return an array off all beans.

More info on loading content beans: http://docs.getmura.com/v6/back-end/base-mura-objects-beans/loading-beans/

Once you've got the right content bean, you can ask for it's fileId.

bean.getFileId()