jQuery File Upload Middleware
Features
- File upload handling
- File size validation
- File type validation
- Made for Express 4.x
Requirements
- Node.JS >= 0.10
- Express >= 4
Install
npm install jfum --save
Usage
var JFUM = ;var jfum = minFileSize: 204800 // 200 kB maxFileSize: 5242880 // 5 mB acceptFileTypes: /\.$/i // gif, jpg, jpeg, png;
OPTIONS
jQuery File Upload makes an OPTIONS request to the server before starting the uppload to make sure that it can upload to the given server.
appoptions'/upload' jfumoptionsHandler;
POST
app;
Error Codes
The req.jfum.files[]
object can have the following error codes:
JFUM-001
- File type not allowedJFUM-002
- File size too bigJFUM-003
- File size too small