Upload file with template

I am trying to use the kirby api to upload a new file into: /api/site/files | Kirby CMS

I have a function in my custom plugin that fires that endpoint and it works the file is saved in the correct place. There is a post parameter template mentioned in the docs however I am unable to set the file template when creating a file.

this.$refs.upload.open({ url: window.location.origin +"/somepage/api/pages/assets/files", multiple: false, })

Iā€™m not sure, could be like that:

this.$refs.upload.open({
  url: window.location.origin + "/somepage/api/pages/assets/files",
  multiple: false,
  attributes: {
    template: "custom"
  }
})
1 Like

Thanks that worked!