https://github.com/chris-burgin/dropbox-session-upload
Node wrapper around the dropbox upload session API to help concurrently upload files over 150mb to dropbox.
https://github.com/chris-burgin/dropbox-session-upload
api concurrent dropbox dropbox-api dropbox-sdk large-files node npm session-upload upload upload-session
Last synced: about 1 month ago
JSON representation
Node wrapper around the dropbox upload session API to help concurrently upload files over 150mb to dropbox.
- Host: GitHub
- URL: https://github.com/chris-burgin/dropbox-session-upload
- Owner: chris-burgin
- Created: 2017-09-20T00:12:27.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-01-19T15:43:07.000Z (about 8 years ago)
- Last Synced: 2025-09-10T04:42:53.261Z (6 months ago)
- Topics: api, concurrent, dropbox, dropbox-api, dropbox-sdk, large-files, node, npm, session-upload, upload, upload-session
- Language: JavaScript
- Homepage:
- Size: 121 KB
- Stars: 4
- Watchers: 0
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Changelog: changelog.md
Awesome Lists containing this project
README
# Dropbox Session Upload
## About
Dropbox Session Upload provides a wrapper around the [Dropbox Node Package](https://github.com/dropbox/dropbox-sdk-js). Session Uploading via the Dropbox
API is used for files that are large than 150mb. This section of the API can
be complicated and this package hopes to provide a clean wrapper around this
complicated API. This wrapper also supports concurrent file uploading out
of the box.
## Requirements
- Node `8.3.0` or greater
## Installation
`npm install dropbox_session_upload`
## Usage
### Upload Files Basic
_This Example can be found in `/examples/simple.js`_
```javascript
// import modules
const fs = require("fs")
const {upload} = require("dropbox_session_upload")
// setup files to upload
const files = [
{
file: fs.createReadStream("./datafile.txt"),
saveLocation: "/datafile1.txt"
},
{
file: fs.createReadStream("./datafile.txt"),
saveLocation: "/datafile2.txt"
},
{
file: fs.createReadStream("./datafile.txt"),
saveLocation: "/datafile3.txt"
}
]
// upload the files
upload(files, process.env.DROPBOXTOKEN, true /* debug mode, defaults to false */)
.catch(error => console.log(error))
.then(() => console.log("Done Uploading!"))
```
### Upload with Progress Tracking
_This Example can be found in `/examples/progressTracking.js`_
Adding progress tracking is simple, but due to the dropbox api progress will
only be updated every 8mb. This is the size of chunks this packages uploads
at once. So you will find that progress jumps in 8mb chunks. While annoying
it can still be helpful to know where your file is at in the upload process.
```javascript
// import modules
const fs = require("fs")
const { upload, progress } = require("dropbox_session_upload")
// setup files to upload
const files = [
{
file: fs.createReadStream("./datafile.txt"),
saveLocation: "/datafile1.txt",
id: "1" // required for progress
},
{
file: fs.createReadStream("./datafile.txt"),
saveLocation: "/datafile1.txt",
id: "2" // required for progress
},
{
file: fs.createReadStream("./datafile.txt"),
saveLocation: "/datafile1.txt",
id: "3" // required for progress
}
]
// upload the files
upload(files, process.env.DROPBOXTOKEN)
.catch(error => console.log(error))
.then(() => console.log("Files Done!"))
// listen for updates to the progress
// this will return `id` and `percentage`
progress(data => console.log(data))
```
### Things to note when uploading
- This library will automatically strip out the following characters from `saveLocation` `* | & ! @ # $ % ^ * ( ) [ ] { } | - _ = + < > ' " < >` to comply with dropbox file name requirements.