In asset constructor, the file parameter expects a JavaScript File Object
instead of a file URI and Skygear SDK will read the file content type and the
file size from it.
You may upload your file via base64 encoded data by setting that to the data
to the base64 field of the constructor and also provide the content type
for it.
The following snippet shows how to create a Skygear Asset using base64 encoded
data:
In asset constructor, the file parameter expects a JavaScript File Object instead of a file URI and Skygear SDK will read the file content type and the file size from it.
You may upload your file via base64 encoded data by setting that to the data to the
base64
field of the constructor and also provide the content type for it.The following snippet shows how to create a Skygear Asset using base64 encoded data: