Skip to main content
Version: 1.0

File uploading

You can try by running this code at your console:

deno run https://mega.js.org/demos/uploading-demo.js
import { getLoggedInStorage } from './logging-in-demo.js'
const storage = await getLoggedInStorage()

const name = prompt('Enter a file name:')
const data = await Deno.readFile(name)

const file = await storage.upload({ name }, data).complete
console.log('The file was uploaded!', file)