FAQ Database Discussion Community


Parse file content during file upload

javascript,json,node.js,express,busboy
I was wondering if someone knows how to extract the file content from an uploaded file when using express/nodejs I have the following code and it's clear how to pipe the input to a filestream, but how do I deserialize the upload to a plain javascript object? The purpose is...

Connect-busboy: When piping file to write steam, file is empty or incorrect depending on type

javascript,html,node.js,express,busboy
I am testing a simple file upload using connect-busboy. I noticed that when I upload a PNG formatted file, the file is uploaded however the content isn't correct - I am unable to open it. I've done md5sum on the source and destination file and they are different. When I...

Post file from one server to another,using node.js , needle , busboy/multer

node.js,multer,busboy
I would like to move a small image from one server to another (both running node). As I search, I haven't found enough. This post remains unanswered. As I started experimenting I wrote the following to the first server : app.post("/move_img", function(req, res) { console.log("post handled"); fs.readFile(__dirname + "/img_to_move.jpg", function(err,...

Streaming an uploaded file to an HTTP request

node.js,express,node-request,busboy,wistia
My goal is to accept an uploaded file and stream it to Wistia using the the Wistia Upload API. I need to be able to add fields to the HTTP request, and I don't want the file to touch the disk. I'm using Node, Express, Request, and Busboy. The code...

How to stop upload and redirect in busboy if mime type is invalid?

node.js,busboy
I am fairly new to Node.js, and I am using Express and Busboy-Connect to create a simple file upload form, for wav files only. Here is what I am trying to do : - start the upload - if the mimetype is not wav, redirect to an error page -...

busboy - is there a way to send the response when all files have been uploaded?

node.js,busboy
I'm trying to upload files to a server using node.js as backend and angular.js as frontend. I'm using express 4 + busboy for this. I have a table in the frontend where I should display all the files I'm uploading. So if I have 3 files and click on upload,...

Busboy doesn't fire 'field' event

angularjs,node.js,xmlhttprequest,busboy
I get the file event of the formData but busboy doesn't fire the other field event. Can someone take a look? I'm using the newest version of node and busboy. The formData is posted via xmlhttprequest. I want to add some other fields than just the file. Busboy: var Busboy...

Error handling when uploading file using multer with expressjs

node.js,express,multer,busboy
I am using multer to save the file on server developed through express & nodejs. I am usign following code. var express = require('express'), multer = require('multer') var app = express() app.get('/', function(req, res){ res.send('hello world'); }); app.post('/upload',[ multer({ dest: './uploads/'}), function(req, res){ res.status(204).end() }]); app.listen(3000); Multer saves the file...