<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <link href="BootstrapFileInput/css/fileinput.min.css" rel="stylesheet" type="text/css" /> <link href="BootstrapFileInput/css/fileinput.css" rel="stylesheet" type="text/css" /> <link href="bootstrap-3.3.5-dist/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> <script src="../Scripts/jquery-1.8.3.min.js" type="text/javascript"></script> <script src="BootstrapFileInput/js/fileinput.js" type="text/javascript"></script> <script src="bootstrap-3.3.5-dist/js/bootstrap.min.js" type="text/javascript"></script> <script src="BootstrapFileInput/js/locales/zh.js" type="text/javascript"></script> <script type="text/javascript" src="BootstrapFileInput/js/fileinput_locale_zh.js"></script> </head> <body> <div class="container kv-main"> <br> <form enctype="multipart/form-data"> <div class="form-group"> <input id="file-1" type="file" multiple class="file" data-overwrite-initial="false" data-min-file-count="2"> </div> </form> </div> </body> <script> $("#file-1").fileinput({ language: ‘zh‘, //设置语言 uploadUrl: ‘#‘, // you must set a valid URL here else you will get an error allowedFileExtensions: [‘jpg‘, ‘png‘, ‘gif‘, ‘pdf‘], //接收的文件后缀 overwriteInitial: false, maxFileSize: 1000, maxFilesNum: 10, //allowedFileTypes: [‘image‘, ‘video‘, ‘flash‘], slugCallback: function (filename) { return filename.replace(‘(‘, ‘_‘).replace(‘]‘, ‘_‘); } }); </script> </html>
时间: 2024-10-03 20:17:24