Upload Binary Helper

uploadBinaryHelper(datasource, imageBase64, name, type)

The uploadBinaryHelper helps with uploading binary files. The Picture Upload sample app shows how to use this function.


The function has the following parameters:

datasourceAn Appery.io REST service instance with POST method to create a file in Files collection.Yes.
imageBase64A base64 string of the image.Yes.
nameA name with which file will be stored. If empty, current date will be used as name.No.
typeImage format as .jpg or .png. If empty .jpg is used.No.

In the following example web_upload is the name of a service instance on a page, and image_base64 is a local storage variable that stores the image in base64 format.

uploadBinaryHelper(web_upload, Apperyio.storage.image_base64.get());