jquery-file-upload-middleware icon indicating copy to clipboard operation
jquery-file-upload-middleware copied to clipboard

Uploads not working

Open colville opened this issue 12 years ago • 4 comments

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?

colville avatar Jan 06 '13 08:01 colville

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.

qooleot avatar Jan 16 '13 21:01 qooleot

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?

naorye avatar Feb 12 '13 07:02 naorye

You have to remove the express.bodyParser. Read the express docs on what it does, but its a superset of express.json+urlencoded+multipart.

qooleot avatar Feb 12 '13 07:02 qooleot

This appears to work for me: app.use(express.bodyParser({ defer: true }));

fabien avatar Jun 01 '13 16:06 fabien