使用node js下载大的zip文件(大约50mb)。

时间:2021-09-08 05:41:13

I want to download large zip file having size around 50 mb using node js. I have tried http.get and I also tried "dld" plugin for file download but not working. Please tell me some way or any plugin which will be useful to solve this download issue.
I am developing this app in node-webkit. My code is working fine for small zip files.
http.get method is working only for small files.

我想用node js下载大小约为50 mb的大型zip文件。我曾经尝试过http。get和我也尝试了“dld”插件文件下载但不工作。请告诉我一些方法或插件,这将有助于解决这个下载问题。我在nodewebkit中开发这个应用。我的代码对小zip文件有效。http。get方法只对小文件有效。

1 个解决方案

#1


0  

You will need to use fs: http://nodejs.org/api/fs.html and write the file to disc. So first http.get the file and write it using fs.writeFile().

您将需要使用fs: http://nodejs.org/api/fs.html并将文件写入磁盘。首先http。获取该文件并使用fs.writeFile()编写它。

fs.writeFile('message.txt', 'Hello Node', function (err) { if (err) throw err; console.log('It\'s saved!'); });

fs.writeFile(“信息。txt, 'Hello Node', function (err) {if (err) throw err;控制台。日志(' \ ' s得救了!”);});

(on mobile, excuse me for my brewity)

(在手机上,原谅我的布雷威蒂)

#1


0  

You will need to use fs: http://nodejs.org/api/fs.html and write the file to disc. So first http.get the file and write it using fs.writeFile().

您将需要使用fs: http://nodejs.org/api/fs.html并将文件写入磁盘。首先http。获取该文件并使用fs.writeFile()编写它。

fs.writeFile('message.txt', 'Hello Node', function (err) { if (err) throw err; console.log('It\'s saved!'); });

fs.writeFile(“信息。txt, 'Hello Node', function (err) {if (err) throw err;控制台。日志(' \ ' s得救了!”);});

(on mobile, excuse me for my brewity)

(在手机上,原谅我的布雷威蒂)