<!--Select File Upload -<ScriptID= "Upload_file_dialog"type= "text/html"> <Div class="Layui-form-item"> <Label class="Layui-form-label">File Upload</label> <Div class="Layui-input-block"> <Button Type="Button"class="layui-btn"onclick="$ (' input[name=uploadfile] '). Click ();"> <I class="Layui-icon"></i> Uploading Files </button> <input type="file"name="UploadFile"style="Display:none;" /> </div> <Label class="Layui-form-label"style="width:100%; text-align:left; padding-left:110px;color:red ;"ID="Uploadfilename">File Upload</label> </div></Script>
// File Upload Change event function (e) { var filePath = $ (this). Val (); = Filepath.substring (filepath.lastindexof ("\ \") +1); $ ("#uploadFileName"). Text (FilePath);});
functionSelectfileclick () {//determine Browser version if(Webim. Browser_info.type = = ' ie ' && parseint (Webim. Browser_info.ver) <= 9) {layui.layer.msg (' Upload file temporarily does not support IE9 (including) the following browsers '); //$ (' #updli_file_form ') [0].reset (); //$ (' #upload_file_low_ie_dialog '). Modal (' show ');}Else{Layui.layer.open ({title:"File Upload", Content: $ (' #upload_file_dialog '). HTML (), area: [' 500px ', ' 300px '], btn: [' Send ', ' Cancel '], yes:function(Index, Layero) {//SendUploadfileboxindex =index; UploadFile (); }, Btn2:function(Index, Layero) {//Cancel } }); //File Upload Change event$ ("Input[name=uploadfile][type=file]"). On ("Change",function(e) {varFilePath = $ ( This). Val (); FilePath= Filepath.substring (filepath.lastindexof ("\ \") +1); $("#uploadFileName"). Text (FilePath); }); }}
layui-open-Uploading Files