标签:pos .net for ror 拖拽上传 ajax core har success
利用layui框架可以上传文件调试拦截成功!
[HttpPost] public IActionResult Method1(IFormFile file) { return Json(new{success="ok"}); }
<div class="layui-card"> <div class="layui-card-header">拖拽上传</div> <div class="layui-card-body"> <div class="layui-upload-drag" id="test-upload-drag"> <i class="layui-icon layui-icon-upload"></i> <p>点击上传,或将文件拖拽到此处</p> </div><input class="layui-upload-file" type="file"> </div> </div> <script> layui.use("upload", function() { layui.upload.render({ elem: ‘#test-upload-drag‘, url: ‘@Url.Action("Method1")‘, accept:"file", done: function(res) { //上传完毕回调 }, error: function() { //请求异常回调 } }); }); </script>
[原]Asp.net Core 2.1.2 测试成功Ajax上传文件新解法
标签:pos .net for ror 拖拽上传 ajax core har success
原文地址:https://www.cnblogs.com/yzpopulation/p/9320632.html