node.js - 用connect-multer上传文件,form中的req.body.photo.name不能访问
迷茫
迷茫 2017-04-17 14:49:36
0
0
602
    <html>
    <head>
       <title><%= title %></title>
        <link rel="stylesheet" href="/stylesheets/style.css" />
    </head>
        <body>
        <h1><%= title%></h1>
        <p>Upload a photo to your account below.</p>
        <form method="post" enctype="multipart/form-data" >
        <p><input type="text",name="photo[name]",placeholder="Name" /></p>
        <p><input type="file", name="photo[image]" /></p>
        <p><input type="submit", value="Upload" /></p>
        </form>
        </body>
    </html>
    app.use(logger('dev'));
    app.use(bodyParser.json());
    app.use(bodyParser.urlencoded({ extended: false }));
    app.use(cookieParser());
    app.use(express.static(path.join(__dirname, 'public')));
    app.use(multipart());

用的是connect-multipart处理的上传,req.body.photo字段却找不到

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

membalas semua(0)
Muat turun terkini
Lagi>
kesan web
Kod sumber laman web
Bahan laman web
Templat hujung hadapan