A node.js server plugin for receiving flow.js uploads
npm install flangeTHIS MODULE IS UNDER ACTIVE DEVELOPMENT AND IS UNSTABLE.
If you'd like to use it, please wait for the 1.0.0 release. Anything in the 0.x version
chain is going to be rapidly iterating and probably won't work half the time.
Create a new Receiver with the appropriate settings. Settable options include:
tmpDir: required A path string that points to the temp file directory where incoming
files should be saved. This will be created if it does not exist.onComplete: optional If not null, this callback will be called after an upload is
complete with a path string pointing to the finalized file. Handle all your post-processing
here (upload to s3, etc). This callback should return a promise.
Flange ships with one server plugin so far, for Hapi.js. Call hapiPlugin
with an options block that includes tmpDir, onComplete, and any overrides to the route
block definitions (options.getOptions = {config: {auth: 'token'}} ) which will be deep
copied into the blocks.
/Macintosh HD/Users/bob/Desktop/bigFile.mov at the same time will overwrite eachThe odds of a collision are naturally pretty small, since it's the full path name that generates
the identifier. Still, this is worth worrying about. For my own implementation, I passed a value
for generateUniqueIdentifier in the flow initialization object that prepends the user's system
identifier, and test on the backend that the flowIdentifier attached to the request has a valid
systemId that matches the currently logged-in user.