I have a URL that contains a file. I am grabbing the buffer of the file with the following code below. How do I get the filename and extension from the buffer "data" below? Example fileURL (puppy picture with a filename and extension of "dog.png").
const https = require('https');
https.get(fileURL, function(response) {
var data = [];
response.on('data', function(chunk) {
data.push(chunk);
}).on('end', function(){
});
});
via Jim M
No comments:
Post a Comment