node-red-web-nodes icon indicating copy to clipboard operation
node-red-web-nodes copied to clipboard

Dropbox Node

Open hindessm opened this issue 11 years ago • 2 comments
trafficstars

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 file
      • file - the basename of the changed file
      • event - the type of event either add or delete
      • data - the raw change object from the api call response

Query

  • Retrieve a file from dropbox:
  • Get dropbox file contents
    • node options
      • filename - full path of file to retrieve
      • localfilename - local file to write content to (optional - defaults to storing content in payload)
    • msg options
      • filename - full path of file to retrieve
      • localfilename - 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 retrieved
      • error - an error object (deleted if the request was successful)

Outputs

  • Write to a file (create/replace)
    • node options
      • filename - filename of the remote dropbox file
      • localFilename - local filename containing the content to be uploaded to dropbox
    • msg options
      • filename - filename of the remote dropbox file
      • localFilename - local filename containing the content to be uploaded to dropbox
      • payload - the content to be uploaded (localFilename takes priority)

Authentication

Users must register their own app at https://www.dropbox.com/developers and paste the required tokens into the node.

hindessm avatar Sep 04 '14 09:09 hindessm

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

knolleary avatar Sep 04 '14 14:09 knolleary

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.

hindessm avatar Sep 04 '14 16:09 hindessm