view - html
<div class="col-sm-12">
<div class="form-group">
<label for="tcicon">图标<a id="reseticon">重置</a></label>
<input id="tcicon" type="file" name="icon" class="form-control">
<input id="tciconsrc" type="hidden" name="icon" class="form-control">
</div>
</div>
-js
postflag = true;
initFileInput("tcicon", "<{spUrl c=proxytc a=uploadicon}>", "");
$("#tcicon").on("fileuploaded", function(event, data, previewId, index) {
var code = data.response.code;
if (code == "0") {
$("#tciconsrc").val(data.response.url);
} else {
layer.msg(data.response.message, {icon: 5, closeBtn: 1, shadeClose: true});
$('#tcicon').fileinput('reset');
}
});
$('#tcicon').on('filecleared', function(event) {
$("#tciconsrc").val("");
});