mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2025-03-22 10:02:22 +00:00
* implement dnd uploader show file upload progress write files to hotdirector build simple flaskAPI to process files one off * move document processor calls to util build out dockerfile to run both procs at the same time update UI to check for document processor before upload * disable pragma update on boot * dockerfile changes * add filetype restrictions based on python app support response and show rejected files in the UI * cleanup * stub migrations on boot to prevent exit condition * update CF template for AWS deploy
25 lines
681 B
JavaScript
25 lines
681 B
JavaScript
function setupMulter() {
|
|
const multer = require("multer");
|
|
// Handle File uploads for auto-uploading.
|
|
const storage = multer.diskStorage({
|
|
destination: function (_, _, cb) {
|
|
const path = require("path");
|
|
const uploadOutput =
|
|
process.env.NODE_ENV === "development"
|
|
? path.resolve(__dirname, `../../../collector/hotdir`)
|
|
: path.resolve(process.env.STORAGE_DIR, `../../collector/hotdir`);
|
|
cb(null, uploadOutput);
|
|
},
|
|
filename: function (_, file, cb) {
|
|
cb(null, file.originalname);
|
|
},
|
|
});
|
|
const upload = multer({
|
|
storage,
|
|
});
|
|
return { handleUploads: upload };
|
|
}
|
|
|
|
module.exports = {
|
|
setupMulter,
|
|
};
|