小编Asi*_*med的帖子

Error in Multer image upload: Unexpected token - in JSON at position 0, SyntaxError: Unexpected token # in JSON at position 0

Please help me to get out of this. This is my uploadRouter.js in which I am trying to upload image file from POSTMAN using multer module

const express = require('express');
const mongoose = require('mongoose');
const autheticate = require('../authenticate');
const multer = require('multer')
const bodyParser = require('body-parser');
const storage = multer.diskStorage({
    destination: (req, file, cb) => {
        cb(null, 'public/images');
    },
    filename: (req, file, cb) => {
        cb(null, file.originalname);
    }
});
const imageFileFilter = (req, file, cb) => {
    if(!file.originalname.match(/\.(jpg|jpeg|png|gif)$/)) {
        return …
Run Code Online (Sandbox Code Playgroud)

rest http node.js express multer

5
推荐指数
2
解决办法
5354
查看次数

标签 统计

express ×1

http ×1

multer ×1

node.js ×1

rest ×1