jquery-file-upload-middleware
jquery-file-upload-middleware copied to clipboard
Uploads not working
I am trying to implement this module with the demo front-end supplied by blue-imp. The server.js in the demo works fine but the module doesn't. I don't get any errors but when the upload starts on the browser I can see the post but it just stays in the pending state and no file is uploaded. The client eventually timesout. Do you have any ideas why this might be or how I can debug it?
I'm guessing you have the expressjs bodyparser turned on, which also uses formidable under the covers. It is assuming control of the multipart upload process. You can turn that off like this:
//app.use(express.bodyParser()); // only use the json and urlencode and not multipart app.use(express.json()); app.use(express.urlencoded());
As a side note, its probably best to detect the bodyParser in express and emit a warning.
I had such problem. The upload starts when select a file but nothing happens. The formidable enters to parse and emit single "progress" event and then nothing. Removing app.use(express.bodyParser()); and adding app.use(express.json()); app.use(express.urlencoded()); didn't help.
Any idea?
You have to remove the express.bodyParser. Read the express docs on what it does, but its a superset of express.json+urlencoded+multipart.
This appears to work for me: app.use(express.bodyParser({ defer: true }));