# multerjs **Repository Path**: luotybest/multerjs ## Basic Information - **Project Name**: multerjs - **Description**: nodejs使用multer模块实现大文件分片上传功能 - **Primary Language**: JavaScript - **License**: ISC - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 3 - **Forks**: 1 - **Created**: 2021-03-29 - **Last Updated**: 2023-04-17 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # multerjs #### 介绍 nodejs使用multer模块实现大文件分片上传功能 #### 需要用到的主要模块 1. express 本项目采用express框架搭建服务器端实例 2. multer multer是用于处理本项目中文件上传的中间件 multer简介: 安装 --> ~$ npm install --save multer 使用: --> 可以通过 multer({dest: '路径'}) 来创建multer实例,但是路径最好提前建好。 --> 若需要更复杂的功能没需要配置storage参数,具体配置参见index.js --> 具体使用见index.js, --> 如果需要用multer来代替body-parser,需要使用 multer实例.none() 作为中间件,且前端传来的数据是 FormData()的实例,具体查看index.html 3. fs-extra 这应该是一个fs模块的再封装,主要用于判断路径是否存在以及在文件合并后将分片目录删除。 #### 安装教程 1. git clone https://gitee.com/luotybest/multerjs.git or git init --> git remote add origin https://gitee.com/luotybest/multerjs.git --> git pull origin master 2. npm install 3. node index.js --> and then browse localhost:8080 if you have installed the nodemon,you can also run "npm start"