Answer the question
In order to leave comments, you need to log in
How to copy a file from a remote server in node.js and save it on your server?
I'm just starting to learn technology like node.js. Help me figure out my issue.
How to copy a file from a remote server in node.js and save it on your server?
In PHP, you can do it through the copy () function, but how in node.js?
Answer the question
In order to leave comments, you need to log in
const http = require('http');
const fs = require('fs');
let file = fs.createWriteStream("test.jpg");
let request = http.get("http://test/test.jpg", response => {
response.pipe(file);
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question