Online Interview Questions

Prepare interviews on Anything, AnyWhere

PHPSCOTS,Blogger, Developer Views: 1593
Uploading image from url using Node js

Simple function In Node.js to save image from URL to local disk/ server

Here we are going to see how to Upload an image from URL in Node js.Whenever we use login with facebook, google or any other social media in node js app, we get some basic information like name, email and profile picture from there. In this post, i will show you how to save google, facebook profile picture to the server with node.js.

Also, Read Node js interview questions

var fs = require('fs');
var https = require('https');
//Node.js Function to save image from External URL.
function saveImageToDisk(url, localPath) {var fullUrl = url;
var file = fs.createWriteStream(localPath);
var request = https.get(url, function(response) {



exports.saveImage(req, res) {

let image_path='./uploads/profile/''.jpg';


Also, Read Best Node JS Interview Questions

Leave a Reply

Your email address will not be published. Required fields are marked *