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需要自己创建

    
    

    
    


    })
  • 相关阅读:
    限制字数输出,,超出的用...
    tablesorter 的使用
    二维数组根据某个特定字段排序
    对维数组排序 array_multisort()的应用
    多个字段关键字查询
    CASE WHEN用法
    type="submit" button的用法
    获取近30天的数据的时间方式
    练习题
    管理经济学第九章
  • 原文地址:https://www.cnblogs.com/jiahaoJAVA/p/9878017.html
Copyright © 2011-2022 走看看