Quantcast
Channel: CNode:Node.js专业中文社区
Viewing all articles
Browse latest Browse all 14821

superagent上传stream时上传内容不全,只上传了一个highWaterMark 大小,哪里问题呢

$
0
0

使用superagent 上传大文件时,例如10M,结果只上传了64k, code:

const request = require('superagent');
const path = require('path');
const fs = require('fs');
const hostUrl = 'http://localhost:3000';

const filePath = path.resolve(__dirname, './data/test-big.json');
const readStream = fs.createReadStream(filePath);

let streamRequest = request.put(hostUrl + '/upload');

readStream.pipe(streamRequest);

觉得流在上传了一个highWaterMark 后就终止了,求助


Viewing all articles
Browse latest Browse all 14821

Trending Articles