2

I want upload large file. (15 GB) But curl result: broken pipe? What am I doing wrong??

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?

Wise Colt
  • 131
  • 2
  • 7

1 Answers1

2

I was to facing this above problem in curl command invested a day in debugging this.

Finally resolved by passing extra parameters to curl command (Tested 512MB File transfer).

--keepalive-time 600 -iv --limit-rate 500K

Try reducing the limit-rate and increaing keepalive-time at your end.

Hopes this helps the one who reaches there.

Nikhilesh Patve
  • 1,760
  • 3
  • 13
  • 31