Bootstrap-fileinput source files are downloaded online
Css:
<link href= ". /.. /static/bootstrap/css/plugins/bootstrap-fileinput/fileinput.min.css "rel=" stylesheet "/>
Js:
<script src= ". /.. /static/bootstrap/js/plugins/bootstrap-fileinput/fileinput.min.js "></script>
<script src= ". /.. /static/bootstrap/js/plugins/bootstrap-fileinput/fileinput_locale_zh.js "></script>
HTML code:
<formenctype= "Multipart/form-data"> <Divclass= "Row"style= "height:500px"> <inputID= "File-1"type= "File"Multiple Class= "File"data-overwrite-initial= "false"Data-min-file-count= "1"> </Div> </form>
Upload
$ ("#file-1"). Fileinput ({uploadurl:'/handler/upload.ashx ',//image upload URLAllowedfileextensions: [' jpg ', ' png ', ' gif '], overwriteinitial:false, MaxFileSize:1000, Maxfilesnum:10, allowedfiletypes: [' Image ', ' video ', ' Flash '], Slugcallback:function(filename) {returnFilename.replace (' (', ' _ '). Replace ('] ', ' _ '); } });
The callback function returns $ after the last success ("#file-1"). On ("fileuploaded",function(Event, data, Previewid, index) {
Alert (Data.response.JsMessage)
})
UPLOAD.ASHX General Handler, returns the JSON format:
Context. Response.Write (Jsonconvert.serializeobject (newtrue1, jsmessage = "Returned Information"}));
Bootstrap-fileinput image Upload