solid-file-client

A Javascript library for creating and managing files and folders in Solid data stores

View the Project on GitHub jeff-zucker/solid-file-client

back to README

DEMO OF USING COPYFILE IN NODE TO UPLOAD A LOCAL FILE TO A REMOTE POD

const auth = require('../node_modules/solid-auth-cli')
const FileClient = require('../')
const fc = new FileClient(auth)

// CHANGE THIS REMOTE URL TO ONE IN YOUR OWN POD!
//
const remote = "https://jeffz.solidcommunity.net/public/square.png"
const local  = "file://" + process.cwd() + "/square.png"

async function run(){
    try {
        await auth.login()
        await fc.copyFile( local, remote )
    }
    catch(err) {
        console.log(err)
    }
}
run()