0
10
KKKhalid Khan
The snippet creates a new promise from the SDK Storage class for appwrite. The first argument is the name of the file, the second argument is the file's ID, and the third argument is the document element's uploader attribute. The promise is then resolved when the user clicks the file's link.
Shortcut: appwrite.createfile
let promise = sdk.storage.createFile('[BUCKET_ID]', '[FILE_ID]', document.getElementById('uploader').files[0]);