fileinput 加 ftp 加 nginx 加 SpringBoot上传文件

亲测可用

准备linux服务器  https://www.cnblogs.com/shuaifing/p/8268949.html

 

搭建ftp https://www.cnblogs.com/shuaifing/p/8260532.html

 

Springboot整合fileinput

上传文件https://www.cnblogs.com/shuaifing/p/8274906.html

 

页面

引入 jquery boostrap  fileinput.min.js fileinput.min.css 

<form  method="post"   class="box-header with-border" action=""  id="dataFrom" enctype="multipart/form-data" >
<label>文件上传:</label>
<input id="file" name="file" multiple="multiple" type="file" class="file">
</form>

js
$(function(){
    var _allowedFile = ['jpg', 'png', 'gif', 'apk', 'zip', 'xlsx', 'xls'];
var _maxFileSize = 10000;
$("#file").fileinput({
language: 'zh', //设置语言
uploadUrl: ctx+"fileupload", //上传的地址
allowedFileExtensions: _allowedFile,//接收的文件后缀
uploadAsync: true, //默认异步上传
showUpload: true, //是否显示上传按钮
maxFileSize: _maxFileSize,
showRemove : true, //显示移除按钮
showPreview : false, //是否显示预览
showCaption: false,//是否显示标题
browseClass: "btn btn-primary", //按钮样式
dropZoneEnabled: false,//是否显示拖拽区域
maxFileCount: 1, //表示允许同时上传的最大文件个数
enctype: 'multipart/form-data',
validateInitialCount:true
});
});

health和images需要自己创建

 
 

 

 
 


})

转载于:https://www.cnblogs.com/jiahaoJAVA/p/9878017.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值