SkygearIO / skygear-doc

[Deprecated] Doc site generator for all the platform guides of Skygear; Content are here: https://github.com/SkygearIO/guides/tree/v1
https://docs.skygear.io/
MIT License
4 stars 19 forks source link

Missing the guide for uploading asset via base64 encoded data (JS, Record type) #488

Closed tensiuyan closed 7 years ago

tensiuyan commented 7 years ago

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:


    name: 'image',
    base64: data,
    contentType: 'image/jpeg',
});```
chpapa commented 7 years ago

This issue was moved to SkygearIO/guides#1