create upload dir ;)
This commit is contained in:
parent
0a13b45cdd
commit
75de4b23f8
2
zad2.js
2
zad2.js
@ -6,6 +6,8 @@ const app = express();
|
||||
const PORT = 49376;
|
||||
const UPLOAD_DIRECTORY = './uploads';
|
||||
|
||||
!fs.existsSync(UPLOAD_DIRECTORY) && fs.mkdirSync(UPLOAD_DIRECTORY);
|
||||
|
||||
const upload = multer({
|
||||
storage: multer.diskStorage({
|
||||
destination: (req, file, cb) => { cb(null, UPLOAD_DIRECTORY); },
|
||||
|
Loading…
Reference in New Issue
Block a user