250x250
Notice
Recent Posts
Recent Comments
- Today
- Total
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Tags
- nginx
- MYSQL
- atlas
- css
- certbot
- jsonwebtoken
- single quote
- flutter
- findByIdAndDelete
- Express
- clipBehavior
- Node.js
- moment
- AWS
- til
- wil
- Nodejs
- double quote
- TailwindCSS
- JavaScript
- mongodb
- mongoose
- TypeScript
- async
- RDS
- await
- Find
- https
- sequelize
- EC2
Link
Archives
반응형
목록multer (1)
기억 휘발 방지소

multer는 파일을 업로드 할 수 있게 도와주는 미들웨어이다. 📌 설치 npm i multer 📌 multer 적용 import multer from "multer"; const uploadFiles = multer({ dest: "uploads/", limits: { fileSize: 5 * 1024 * 1024 }, }); 업로드한 파일이 uploads/ 폴더 안에 저장된다. limits는 업로드할 파일의 크기를 제한한다. 단위는 Byte 제한보다 큰 파일을 업로드할 경우 아래처럼 에러를 발생시킨다. userRouter .route("/edit") .post(uploadFiles.single("avatar"), postEdit); 파일을 하나만 업로드 할 때는 single을 쓰면 된다. 📌 템플릿 ..
Web/Node.js
2021. 9. 27. 16:14
반응형