javascript - Express how to upload files and transmit strings at the same time?
怪我咯
怪我咯 2017-07-05 10:39:05
0
1
538

<form class="" method="post" action="/web/project/<%=projectName%>/importFile">

    <p class="form-group">
        <label>选择文件</label>
        <input class="form-control" type="file" name="file"/>
    </p>
    <p class="form-group">
        <label>数据格式</label>
        <select id="ext-select" class="form-control" name="ext">
            <option value="csv" default>csv</option>
            <option value="json">json</option>
            <option value="js">js</option>
            <option value="xml">xml</option>
            <option value="txt">txt(文本格式,目前用于pc端)</option>
        </select>
    </p>

File upload requires enctype="multipart/form-data", but the body-parser in express4 does not recognize the data submitted by enctype="multipart/form-data", but if you cancel this, the file cannot be uploaded, what should I do

怪我咯
怪我咯

走同样的路,发现不同的人生

reply all(1)
伊谢尔伦

Change a plug-in, such as multiparty, and check the documentation for usage after the installation is complete

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!