Skip to content

Loading…

Server to server image transfer, only some of the packets #614

Closed
zachrybaker opened this Issue · 1 comment

2 participants

@zachrybaker

POST/PUT of a 3MB image seems to only transfer 1/3 to 1/2 of image. Some packets make it, some don't.

I'm sending between node servers (which happen to be on the same machine, for dev).

The sender:
fs.createReadStream(imgPath + imgFilename).pipe(
request({url:'https://' + config.hostname + ':' + config.portHttps + '/saveImg.jpg?filename='+imgFilename, method: 'PUT'}, function(e, r, body){console.log('done');}));

The receiver:
var writeStream = fs.createWriteStream(req.query.filename);
req.pipe(writeStream);
req.on('end', function () {
res.send(200, {});
});
writeStream.on('error', function (err) {
console.log(err);
});

The receiver never complains, and the image will be posted, but the image will be incomplete, every time.

The beauty of your module is it's supposed to be simple. But what are the tricks to make it work in this situation?

@mikeal
request member

Is this still an issue?

This is so old I'm closing, if it is actually still an issue just let me know and I'll re-open.

@mikeal mikeal closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.