且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用请求模块下载,然后上传没有中间文件的文件

更新时间:2022-11-28 16:10:09

根据request文档,您可以使用

request.get(sourceUrl).pipe(request.post(targetUrl))

在此方案中,数据将从sourceUrl流到targetUrl,但无需保存在服务器上的临时文件中.

in this scheme, the data will flow from sourceUrl to targetUrl but will not need to be saved in a temporary file on the server.

cf https://github.com/request/request#streaming 了解更多详细信息.

cf https://github.com/request/request#streaming for more details.