By uploading a file as an object body, you can associate and manage the file with a KiiObject.
(This feature is not available in SDK v3 series because the callback itself is obsoleted.)
You cannot use the object body upload feature in server code.
The following sample code shows how to upload an object body after KiiObject creation.
Here is what is happening in the sample code:
Set key-value pairs (e.g., file name, file size, and the availability of an object body) in a KiiObject as needed.
Call the save() method to create a new KiiObject on KiiCloud.
Create a blob for the target file.
Start uploading by calling the uploadBody() method.
(For SDK v2 series,) the progress callback will be called as the upload progresses. It can reach 100% on the first call if the data size is small.
You need to create a KiiObject with the save() method prior to uploading its object body with the uploadBody() method.
Set the content type in a form of "type/subtype". The content type sent to Kii Cloud will be used when the object body is downloaded and when the object body is published and viewed on the browser.