Git Product home page Git Product logo

Comments (14)

vivian-ho avatar vivian-ho commented on July 24, 2024 1

I do see data when doing this
req.on('data', function(d) {
console.dir(''+d);
});

but req.busboy.on('file' is not firing...what could be wrong

from connect-busboy.

mscdex avatar mscdex commented on July 24, 2024

What does console.dir(req.headers['content-type']) show?

from connect-busboy.

kdelemme avatar kdelemme commented on July 24, 2024

I got:

'multipart/form-data; boundary=----WebKitFormBoundaryVBzQ858LzyYb4fNA'

from connect-busboy.

mscdex avatar mscdex commented on July 24, 2024

Can you verify that there is data available from the request at that point by adding req.on('data', function(d) { console.dir(''+d); }); after the req.pipe(req.busboy);?

from connect-busboy.

kdelemme avatar kdelemme commented on July 24, 2024

When it works I have:

 '------WebKitFormBoundary0aO5BTZJMzQXbtVQ\r\nContent-Disposition: form-data; name="file"; filename="file.csv"\r\nContent-Type: text/csv\r\n\r\nname,radius, ....

from connect-busboy.

mscdex avatar mscdex commented on July 24, 2024

What about when it doesn't work (when all you were seeing was your here output)? Do you get any data then?

from connect-busboy.

mscdex avatar mscdex commented on July 24, 2024

Also, if you can share the exact form you're trying (and which browser you're using), I can try to reproduce it on my end.

from connect-busboy.

kdelemme avatar kdelemme commented on July 24, 2024

I don't see anything when it doesn't work. Must be my frontend which doesn't send the form correctly. I'm using angular with angular-file-upload to upload the file. So it could be complicated to share the code with you.

from connect-busboy.

mscdex avatar mscdex commented on July 24, 2024

If you're not seeing any data when it doesn't work then some middleware up in your middleware stack must be reading all of the data before it gets to your route handler that uses busboy.

from connect-busboy.

kdelemme avatar kdelemme commented on July 24, 2024

That makes sense. I'll investigate this. Thanks!

from connect-busboy.

kdelemme avatar kdelemme commented on July 24, 2024

Ok, I found what the issue was: I was using bodyParser() 1.3.x. After switching to the latest version and using the proper middleware json/urlencoded, busboy works nicely. Thanks

from connect-busboy.

mscdex avatar mscdex commented on July 24, 2024

Glad to hear you got things sorted out!

from connect-busboy.

lakshaygaur avatar lakshaygaur commented on July 24, 2024

@kdelemme How did you configure it exactly cause Im having the same issue with express.

from connect-busboy.

shubham-gulati avatar shubham-gulati commented on July 24, 2024

hey, am getting same problem. My console.dir(req.headers['content-type']) shows below
multipart/form-data; boundary=----WebKitFormBoundaryU9h6r30qkD4r6BPb

Can someone help me fetching form data?

using this to upload form data
$.ajax({
method: "POST",
url: "http://localhost:3000/api/v1/newPlatterPartner",
contentType: "application/octet-stream",
enctype: 'multipart/form-data',
contentType: false,
processData: false,
data: formData,
success: function (response) {
alert("Success");
}
});

Please someone help...its urgent?

from connect-busboy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.