亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Nodejs:通過循環鏈接數組下載多個文件時出錯

Nodejs:通過循環鏈接數組下載多個文件時出錯

DIEA 2021-07-06 13:15:47
var ultUrls = [{  url: 'https://i.redd.it/kl44uq60z4631.png',  name: 'pics/A bison in steam during winter at Yellowstone National Park.png'}, {  url: 'https://i.redd.it/9eocp20xr6631.jpg',  name: 'pics/Athens at night.jpg'}, {  url: 'https://i.redd.it/0gezn9zjr6631.jpg',  name: 'pics/This is Rayne. Her favorite color is orange. Her job is a clown for the circus. Her motto is *honk honk*..jpg'}, {  url: 'https://i.redd.it/fxcivargr6631.png',  name: 'pics/Reddit your input is greatly appreciated.png'}, {  url: 'https://i.redd.it/xzpukskhr6631.jpg',  name: 'pics/Cranberry lake Ontario.jpg'}, {  url: 'https://i.redd.it/4mplt3joh5631.jpg',  name: 'pics/Pics of insects are the best.jpg'}, {  url: 'https://i.redd.it/03q4c5ndq6631.jpg',  name: 'pics/Elvis Presley during his service in the U.S. Army.jpg'}]下載此數組中的文件時,我收到了 ENONENT:沒有這樣的文件或目錄,請打開... var downloadImages = function(callback) {    ultUrls.forEach( function(str) {     download_file_httpget(str.url, str.name, function(){console.log('Finished Downloading' + filename)});   }); }var download_file_httpget = function(url, dest, callback){     request.get(url)     .on('error', function(err) {console.log(err)} )     .pipe(fs.createWriteStream(dest))     .on('close', callback); };
查看完整描述

3 回答

  • 3 回答
  • 0 關注
  • 282 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號