Adi – 19-20 Jan 10
I am uploading file image/video but in nodejs it is only working if I upload local image/video and not if I download it from some url.
Code:
‘’’
const downloadImageFromUrl = async () => {
const video = await axios.get(
const buffer = Buffer.from(video.data, 'binary').toString('base64');
return buffer;
}
‘’’
Now is above code different if I read mp4 or png jpeg file from local using fs.readFile in nodejs??
Code:
‘’’
const downloadImageFromUrl = async () => {
const video = await axios.get(
https://i.imgur.com/rfYwI5n.mp4, { responseType: 'arraybuffer' });const buffer = Buffer.from(video.data, 'binary').toString('base64');
return buffer;
}
‘’’
Now is above code different if I read mp4 or png jpeg file from local using fs.readFile in nodejs??
