Server-side file storage using Filepicker.io
The fantastic folks at Filepicker.io have a service that allows for easy storage of files, primarily on the client-side. There may, however, be instances in which you want to put photos from the server-side into your Filepicker bucket.
That's where this library comes in. Modified from the client library maintained by the Filepicker staff, this server-side library simply makes RESTy requests.
$ npm install filepicker
or using Git
$ git clone git://github.com/filepicker/cellar.git node_modules/filepicker/
This library only implements one of the methods from the client library (getUrlFromData) as well as two methods more suited to a Node environment
var Filepicker = require'filepicker';var filepicker = 'YOUR_API_KEY';
filepickergetUrlFromData"some text to store" persist:trueconsole.log"my file is stored at "+url;;
- A direct translation from the client library, stores contents of a file
filepickergetUrlFromUrl'' persist:trueconsole.log"the picture at is now stored at "+url;;
- Makes a request to the specified location, and stores the data found there on Filepicker
fsreadFile'/myfile.txt'filepickergetUrlFromBufferbuf persist:trueconsole.log"myfile.txt is now stored at "+url;;
- Stores a Buffer on Filepicker