import path from "path";
import multer from "multer";

// const publicFolder = path.resolve(__dirname, "..", "..", "public");
const publicFolder = path.resolve(__dirname, "..", "..","..","..", "public");

console.log('publicFolder: ',publicFolder)

export default {
  directory: publicFolder,

  storage: multer.diskStorage({
    destination: publicFolder,
    filename(req, file, cb) {
      const fileName = new Date().getTime() + path.extname(file.originalname);

      console.log('THE FILE NAME FROM MULTER: ',fileName)

      return cb(null, fileName);
    }
  })
};
