Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Carlos Fructuoso analistacarlosh

🎯
Focusing
View GitHub Profile
@tanaikech
tanaikech / submit.md
Last active Jul 24, 2021
Uploading Files to OneDrive Using Node.js
View submit.md

Upload contents for an item on OneDrive

In order to use this script, please retrieve client id, client secret and refresh token before. About this, you can see the detail information at https://gist.github.com/tanaikech/d9674f0ead7e3320c5e3184f5d1b05cc.

1. Simple item upload

This is for the simple item upload is available for items with less than 4 MB of content. The detail information is https://dev.onedrive.com/items/upload_put.htm.

var fs = require('fs');
var mime = require('mime');
var request = require('request');