Questions tagged [busboy]

A streaming parser for HTML form data for Node.js

busboy is a module for parsing incoming HTML form data.

268 questions
1
vote
2 answers

How do I recover from failure when uploading multiple files via my server to S3?

New to NodeJS and S3, I wrote the following exploratory code to upload files to S3 via my NodeJS server without saving the file to disk or memory: var express = require('express'); var Busboy = require('busboy'); var S3 =…
markvgti
  • 4,321
  • 7
  • 40
  • 62
1
vote
1 answer

How to detect an upload stream stopped unexpectedly with busboy

I have a process uploading files into mongodb which works fine. But I have one big problem. If for some reason the connection is lost (the client browser closed, bad internet connection, power is down etc.), I have no indication and busboy/req…
Itay Merchav
  • 954
  • 8
  • 8
1
vote
1 answer

Busboy seems to be causing an internal server error when requiring it in my uploadImage function for Firebase

I've spent pretty much all day trying to figure out how to successfully upload photos into my storage and database, and so far I can't even get one to be successful! Essentially I'm using postman to send a post request with an image file attached. I…
1
vote
1 answer

How to upload a single file with a title using busboy

I am trying to upload an image with it's title to Cloud Storage using react as frontend and busboy for handling the upload in the backend but I can't seem to get it working. When I submit the form I get an error saying that event.target.files[0] is…
1
vote
2 answers

Upload multiple images on Firebase using NodeJS and Busboy

I created function for uploading a single image on Firebase using NodeJS and Busboy, which returns image url. Allowed image extensions are only .jpg and .png. It will generate random filename and create filepath with storageBucket. However, I am…
Dromediansk
  • 21
  • 1
  • 4
1
vote
0 answers

Busboy finish not fired

I want to pass original file stream pass down to other layer of code which will handle later drop on disk (upload to cloud storage) behavior. As files size might be large I can't actually fully buffer incoming file. I assume that PassThrough stream…
Artsiom Miksiuk
  • 3,896
  • 9
  • 33
  • 49
1
vote
3 answers

Image upload error: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string

I am building backend functions with node.js and firebase. I used BusBoy to build an image upload function; I check my code again and again, changed the image with a smaller size one (like 140 kb) and tried to detect the problem and from the code I…
Oner T.
  • 394
  • 1
  • 7
  • 22
1
vote
0 answers

How to cancel a busboy / express file upload stream (mid stream)

I am using express and busboy to upload a file (from an Angular app). If a large file is being uploaded and an error is detected - such as "file path does not exist", the only way to respond to the client is to wait for the full file upload stream…
Joe Wearing
  • 147
  • 2
  • 10
1
vote
0 answers

How to upload images and keep track of them using a database using multer or busboy?

I am trying to upload images or pdfs (files in general) using express and the two modules i have come across are multer and busboy. The image uploading process is easy however i have come across problems with both of them. What i want is to upload…
Usman Abdur Rehman
  • 334
  • 1
  • 3
  • 13
1
vote
1 answer

Mock busboy with jest

I have an express POST route set-up in index.js as following import * as Busboy from 'busboy'; public publish = async (req: Request, res: Response) => { const busboy = new Busboy({ headers: req.headers }); const pl = { title: '' }; …
meteor
  • 2,518
  • 4
  • 38
  • 52
1
vote
3 answers

How to whitelist boolean true/false or string 'true'/'false'

Is there a way to whitelist a property value in expressjs? IE I would like to limit a properties values to either a Boolean true/false or the string 'true'/'false'. Because truthy sucks in JS I cannot just do this var foo =…
lostintranslation
  • 23,756
  • 50
  • 159
  • 262
1
vote
2 answers

Resizing image with busboy and sharp in firebase cloud function/Nodejs

Having a problem when uploading to firebase cloud functions.. I'm using busboy and sharp to achieve this but every time I run my code it only return "finished with status: 'timeout'" with no error... this code will work without the sharp resize…
Renz M
  • 87
  • 10
1
vote
0 answers

TypeError: Cannot read property 'file' of null busboy in firebase cloud function

I'm trying to write a simple function which takes a request containing multipart/form data and uploads the image to the firebase cloud storage using busboy, but in the cloud functions console it throw the following error "TypeError: Cannot read…
1
vote
1 answer

connect-busboy catch no file scenario

I am using connect-busboy to upload a file for attachment of email. The code is working fine if one file is present. However, I want to catch the scenario where there is no file attached/uploaded. Initially i thought I will check for the size of…
Raghuveer
  • 1,413
  • 3
  • 23
  • 39
1
vote
0 answers

TypeError: Cannot read property 'element' of undefined with busboy in node.js

I am trying to upload a file to aws s3, I find the error: TypeError: Can not read property 'element2' of undefined I have tried to modify the variables, but the error continues, when I change req.file.element2 by req.body.element2 the error stops…
Alvaro Vergara
  • 83
  • 1
  • 12