【发布时间】:2020-04-16 05:47:32
【问题描述】:
我想使用 expressjs 将文件从其他网站下载到我的电脑
我尝试使用:res.download 进行下载,但它似乎只能在我自己的服务器上运行
这是我的代码:
res.download('http://apkleecher.com/download/dl.php?dl=com.instagram.android', 'folder', function(err){
if (err) {
console.log(err);
} else {
}
});
它返回错误:
{ 错误:ENOENT:没有这样的文件或目录,stat '/home/keitaro/Desktop/google-play/http:/apkleecher.com/download/dl.php?dl=com.instagram.android' 错误号:-2, 代码:'ENOENT', 系统调用:'stat', 路径:'/home/keitaro/Desktop/google-play/http:/apkleecher.com/download/dl.php?dl=com.instagram.android', 暴露:假, 状态码:404, 状态:404 }
在我的猜测中,问题出在 url 的路径上。
【问题讨论】:
-
你可能想要
request()module。 -
@jfriend00 是的,这是正确答案