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

curl: (55) Send failure: Broken pipe error #3312

Closed
szbk opened this issue Oct 10, 2015 · 1 comment
Closed

curl: (55) Send failure: Broken pipe error #3312

szbk opened this issue Oct 10, 2015 · 1 comment
Labels
question Issues that look for answers.

Comments

@szbk
Copy link

szbk commented Oct 10, 2015

Hi.

My app.js

var http = require('http');
var fs = require('fs');

http.createServer(function(req, res){

var newFile = fs.createWriteStream('new_file.mkv');
var method = req.method;
var newSize = 0;

if(method == 'PUT'){

  req.pipe(newFile);

  req.on('data', function(chunk){

    newSize += chunk.length;
    console.log(newSize);
  });

}
}).listen(8000, function(){

console.log('Listening..');
});


console command:

curl --upload-file read.mkv http://127.0.0.1:8000


Result:
curl: (55) Send failure: Broken pipe


What am I doing wrong?

@bnoordhuis
Copy link
Member

Can you direct your question to https://github.com/nodejs/help? Thanks.

@bnoordhuis bnoordhuis added the question Issues that look for answers. label Oct 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Issues that look for answers.
Projects
None yet
Development

No branches or pull requests

2 participants