Full stack solution to file uploading, with backend express and front-end AMD support.
How it works
Transports data via primarily via websockets and utilizes the browser FileReader api. The
ws library is used to listen to ws://.../upper to establish a file upload queue between the client and the server.
Support (for now)
- Latest 4/5 versions of Chrome, Firefox
- Safari 6+
Server side code:
var app =server =// pass a server instance to establish websocket connectionupper = server: server ;// serve client side code and using expressjs middleware pluginapp;// Get all complete uploaded files in once place:upper;
// Create upper listener instance to file input elementvar upper =uploader = upper// get callback with preview url// get notified of upload progress;// event on completed image upload// - you can pass back data from the server here// This is useful for passing back data like save location etc;
The project is built using browserify to maximise modularity since much of the code is applicable on both the backend and the frontend. To run and build all frontend files run
npm run build. This witll populate the
./lib/static/dist folder with all the frontend code as well as minified versions.
For local tests run
npm test to run the full suite.
- Upload from social media accounts (facebook, twitter, g+ etc) - requires auth procedure
- Upload from webcam