node-red-web-nodes
node-red-web-nodes copied to clipboard
Dropbox Node
Input
- Watch for changes to dropbox:
- node options
filepattern- minimatch/glob pattern to filter files on (optional, default include all files)
- output msg properties
payload- the full path of the changed filefile- the basename of the changed fileevent- the type of event eitheraddordeletedata- the raw change object from the api call response
- node options
Query
- Retrieve a file from dropbox:
- Get dropbox file contents
- node options
filename- full path of file to retrievelocalfilename- local file to write content to (optional - defaults to storing content in payload)
- msg options
filename- full path of file to retrievelocalfilename- local file to write content to
- output msg properties
payload- the content of the file (deleted if there is an error)filename- the full path of the file retrievederror- an error object (deleted if the request was successful)
- node options
Outputs
- Write to a file (create/replace)
- node options
filename- filename of the remote dropbox filelocalFilename- local filename containing the content to be uploaded to dropbox
- msg options
filename- filename of the remote dropbox filelocalFilename- local filename containing the content to be uploaded to dropboxpayload- the content to be uploaded (localFilenametakes priority)
- node options
Authentication
Users must register their own app at https://www.dropbox.com/developers and paste the required tokens into the node.
The out node should be consistent with the File Out node.
- it should be possible to provide the complete filename in the node itself (optionally overridden by msg.filename)
- it should provide options to both overwrite and append to the file
There isn't an api to do appending so you'd need to download the current copy, keeping it locally and upload the whole thing each time you extend it, so I'd be inclined to not support that?
Regardless, I agree we should aim for compatibility between dropbox/s3 file upload and file out and clearly document any differences. That is what I am currently trying to do. I wanted to make a start on the s3 node to better understand the different APIs before trying to define the common interface.
For instance, having looked at the s3 api, I'm cautious about supporting the payload option since, although it seems natural with the dropbox api, for the s3 node that would mean you'd need to write to a temp file first which seems a little inelegant.