jfinal上传图片

<form class="layui-form" method = "post" action="" enctype="multipart/form-data" >

<div class="layui-form-item">

<label class="layui-form-label">项点名称:</label>

<div class="layui-input-block">

<input type="text" name="ca.name" required

placeholder="请输入名称" autocomplete="off" class="layui-input">

</div>

</div>

<div class="layui-form-item">

<label class="layui-form-label">车号:</label>

<div class="layui-input-block">

<select id="select_number" name="ca.c_number_id" lay-filter="role" >

<option value=""></option>

#for(x : list)

<option value="#(x.id)">#(x.c_number)</option>

#end

</select>

</div>

</div>

<div class="layui-form-item">

<label class="layui-form-label">项点描述:</label>

<div class="layui-input-block">

<textarea  name="ca.descirption" placeholder="请输入描述" class="layui-textarea"></textarea>

</div>

</div>

<div class="layui-form-item">

<label class="layui-form-label">上传图片:</label>

<input  type="file" accept="image/*" id="chooseImage" name="file" width= 300px>

<img id="cropedBigImg" value='custom'  data-address='' height=80px margen-top:10px/>

</div>

<div class="layui-form-item">

<div class="layui-input-block">

<button class="layui-btn" lay-submit lay-filter="form-btn" >立即提交</button>

<button type="reset" class="layui-btn layui-btn-primary">重置</button>

</div>

</div>

</form>

使用from上传图片是在controller中使用getFile();时报错Posted content type isn't multipart/form-data,怎样解决

评论区

JFinal

2019-11-08 15:06

异常提示:
Posted content type isn't multipart/form-data,

检查提交是不是被做了 302 重定向:
https://www.oschina.net/question/816381_108867
https://www.oschina.net/question/941098_93842

热门反馈

扫码入社