expressjs / multer

Node.js middleware for handling `multipart/form-data`.
MIT License
11.47k stars 1.04k forks source link

empty req.body and req.file when run in firebase hosting #572

Open nateshmbhat opened 6 years ago

nateshmbhat commented 6 years ago

I don't know if its the problem of firebase or multer .


app.post('/' ,  multer({ dest: "data/" , limits : { fileSize : 5242880 } }).single('image_file'),  (req , res)=>{

    console.log("req.body : " , req.body) ;
    console.log("req.file  : " , req.file) ; 

It works fine on my local server but when I deploy it to firebase , it gives me empty req.body and req.file . How to fix this ?

franciscomemoli commented 6 years ago

Same problem here, any solution?

nateshmbhat commented 6 years ago

I found out that a firebase update made this multer module unworkable . So we can't use multer with firebase hosting now .

Read this Handling multipart data

franciscomemoli commented 6 years ago

Thanks for the reply, I found this yesterday https://stackoverflow.com/questions/47242340/how-to-perform-an-http-file-upload-using-express-on-cloud-functions-for-firebase . I had fix the problem with the express-multipart-file-parser is the eases way. Thanks again!

nateshmbhat1 commented 6 years ago

Did express-multipart-file-parser module work for u after deploying?

I thought the only working solution was to use the busboy module which required lot of bloatware code.

nickjuntilla commented 5 years ago

Thanks for pointing out the firebase bug! I ended up using busboy. It was the only way that worked for me. 2 days on this so far!