I am using protractor.I have to download some no.of images and upload that to corresponding locations and each of the images are different.I have used below code for this
const download = require('image-downloader');
options = {
url: 'https://dbamedia.blob.core.windows.net/files/34f6fbc070754541a8828bb78c6a1e87',
dest: './files'
}
download.image(options).then(({ filename, image }) => {
console.log('File saved to', filename)
}).catch((err) => {
console.error(err)
});
I am able to download the image by this code.but when i am checking the destination folder, file name not having the extensions(.jpg,.png).So that when i am trying to upload these files, i am getting an error 'file is not supporting' .If its downloaded with the file extension, i am able to upload it successfully.How can i solve this.Thanks in advance.