25 lines
786 B
JavaScript
25 lines
786 B
JavaScript
//var JSZip = require("jszip");
|
|
const axios = require("axios"); // to get the images
|
|
require("dotenv").config();
|
|
|
|
module.exports.downloadImages = async function(req, res) {
|
|
if (process.env.NODE_ENV !== "production") {
|
|
console.log("[IMAGES] Incoming Images to Download", req.body);
|
|
}
|
|
// const zip = new JSZip();
|
|
// //res.json({ success: true });
|
|
// req.body.images.forEach(i => {
|
|
// axios.get(i).then(r => zip.file(r));
|
|
// // const buffer = await response.buffer();
|
|
// // zip.file(file, buffer);
|
|
// });
|
|
// // // Set the name of the zip file in the download
|
|
// res.setHeader("Content-Type", "application/zip");
|
|
|
|
// zip.generateAsync({ type: "nodebuffer" }).then(
|
|
// function(content) {
|
|
// res.send(content);
|
|
// }.bind(res)
|
|
// );
|
|
};
|