Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nateshmbhat opened this issue Mar 27, 2018 · 5 comments · May be fixed by #789
Open

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

nateshmbhat opened this issue Mar 27, 2018 · 5 comments · May be fixed by #789

Comments

@nateshmbhat
Copy link

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
Copy link

Same problem here, any solution?

@nateshmbhat
Copy link
Author

nateshmbhat commented Jun 10, 2018

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
Copy link

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
Copy link

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
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants