Making Data Securely Available on Davinci


Users on the davinci platform are allocated an amount of storage on the davinci servers. There they can save file such as pictures and movies, which can also include data files such as csv files or json files. (see Media on davinci) Media is uploaded through the Home app

Scripting


Data can be scripted and posted to the davinci server so that hosting data can be automated.

The following code posts an array of numbers with the name "test.json".


let result = await $url({
	url:'/post-media/',
	data:{
		name:'test.json',
		content:JSON.stringify([1,2,3,4,5])
	}
});
					


The result will either be an error message indicating that the save failed for some reason, or it will be message indicating the id that is assigned to the dataset. This id can be used to replace the data saved with the given id

When a folder is not specified, the content is saved to the users root folder. A user can specify the id of a folder to save the data too


let result1 = await $url({
	url1:'/post-media/',
	data1:{
		folderid:'2542a5d4-67a2-4500-99d8-b6814575e90d',
		name:'test.json',
        content:JSON.stringify([1,2,3,4,5])
    }
});
					


Once a dataset has been saved to the server, it can be replaced by including the id in the call to '/post-media'.


let result = await $url({
  url:'/post-media/',
  data:{
    id:'73e12301-9de4-4d73-96dd-8d8416a94bc9.json',
    content:JSON.stringify([1,2,3,4,5])
  }
});