zoukankan      html  css  js  c++  java
  • 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需要自己创建

    
    

    
    


    })
  • 相关阅读:
    P2426 删数
    P2115 [USACO14MAR]破坏Sabotage
    P2679 子串
    P2979 [USACO10JAN]奶酪塔Cheese Towers
    P1114 “非常男女”计划
    P2105 K皇后
    P4053 [JSOI2007]建筑抢修
    P1294 高手去散步
    P4316 绿豆蛙的归宿
    P2253 好一个一中腰鼓!
  • 原文地址:https://www.cnblogs.com/jiahaoJAVA/p/9878017.html
Copyright © 2011-2022 走看看