Hi, I'm building an property editor to add child nodes to the current node. This is working fine with the contentResource.publish(content, true, []).
But I also need to send files with it and can't figure out how. I tried it like var files = $("input[type='file']")[0].files to check if that would work. But it didn't.
Could somebody give me an example of how get the files out of the document and send them with the publish call?
contentResource.publish with files
Hi, I'm building an property editor to add child nodes to the current node. This is working fine with the
contentResource.publish(content, true, [])
. But I also need to send files with it and can't figure out how. I tried it likevar files = $("input[type='file']")[0].files
to check if that would work. But it didn't.Could somebody give me an example of how get the files out of the document and send them with the publish call?
Thanks, W
Found the awnser myself. For anybody who's ever looking for this: Get the files by using
fileManager.getFiles()
.For further reference see these Umbraco files:
https://github.com/umbraco/Umbraco-CMS/blob/5397f2c53acbdeb0805e1fe39fda938f571d295a/src/Umbraco.Web.UI.Client/src/common/directives/components/upload/umbfileupload.directive.js
https://github.com/umbraco/Umbraco-CMS/blob/c09cd95eb6a9faa587f81afb79d543652c3f48bd/src/Umbraco.Web.UI.Client/src/views/propertyeditors/fileupload/fileupload.controller.js
https://github.com/umbraco/Umbraco-CMS/blob/5397f2c53acbdeb0805e1fe39fda938f571d295a/src/Umbraco.Web.UI.Client/src/common/services/filemanager.service.js
is working on a reply...