Basic upload
Upload file easly, that's it !
Requirement
You need to use the latest stable version of Node.js (4.2 or higher)
How it works
The module deserve an upload function which use Promise
.
The files are stored in the directory uploads at the top of your application.
Example
const upload = ; // assuming an express app// don't forget to enable multipart/form-data app;
API
function upload(params) params is an object who can hold :
- file: unique file
- files: array of files
- parentDirectory: name of the parent directory
- dirname : name of the directory where the files will be uploaded
The function resolve a filesUploaded variable which is an array of object who contain the filename and the path for each file.