Files & Images¶
Upload files and images from an HTML Page. The returned data is used to populate a file or image column — typically by passing it into updateRow or addRow (see Rows). The sdk instance below is created and initialized as shown in Initialization.
Return value
Unlike the row methods, the upload methods resolve to the result object directly — there is no .data wrapper.
uploadFile
Upload a file for use in a file column.
Parameters
file- object — the file to upload (for example, a
Filefrom an<input type="file">)
Returns { name, size, type, url } — pass this object as the value of a file column.
Example
uploadImage
Upload an image for use in an image column.
Parameters
file- object — the image file to upload
Returns { name, size, type, url } — same shape as uploadFile, with type set to "image". Pass the URL as the value of an image column.
Example