-
Notifications
You must be signed in to change notification settings - Fork 1
Assets
Clemens edited this page Aug 8, 2024
·
2 revisions
Assets such as images or JavaScript files and be stored in a webstrate and accessed as resources. Uploading cat.png to the webstrate with ID 3FKdw63263aUrNEjYFE7uckqfQqf will make the resource accessible on /s/3FKdw63263aUrNEjYFE7uckqfQqf/cat.png.
To upload one or more assets using your operating system's built in file picker call:
webstrate.uploadAsset()To programmatically upload a file use:
webstrate.addAssetFromFile(file)To delete an asset:
webstrate.deleteAsset(assetName)When an asset is added the asset event is triggered, and when one is deleted the assetDeleted event is triggered.