<div class= "Form-group" >
<label class= "col-xs-2 control-label col-xs-offset-1" > System pictures </label>
<div class= "Col-xs-7" >
<div class= "Input-group" ng-show= "YES" >
<input class= "File-name form-control" type= "text" readonly= "readonly" id= "Fileitem" value= "{{fileitem.name}}" Ng-model= "Fileitem.name"/>
<div class= "INPUT-GROUP-BTN" >
<input type= "File" accept= "image/*" file-model= "myFile" name= "certificate" class= ' input-file files fff ' id= "F" oncha Nge= "Txt.value=this.value" size= "1" hidefocus nv-file-select uploader= "uploader"/>
<input type= "button" onmousemove= "F.style.pixelleft=event.x-60;f.style.pixeltop=this.offsettop;" value= "Select Picture" size= "onclick=" F.click () "class=" Btn-info btn Liulan ">
</div>
</div>
<div class= "Input-group" ng-show= "NO" >
<div class= "INPUT-GROUP-BTN" >
<input class= "Form-control" readonly type= "text" name= "Branchpn_add" name= "Sysimagepc_add" value= "{{sysimagepc_ Add}} "Ng-model=" Sysimagepc_add "style=" width:82%; " >
<input type= "button" value= "re-select" ng-click= "Chooseagain ()" size= "" class= "Btn-info btn Liulan" >
</div>
</div>
<div class= "Input-group imgsrc" ng-show= "yess" >
</div>
<br/>
<a class= "btn btn-info" ng-click= ' UploadFile () ' > Uploads </a>
<a class= "btn btn-default" ng-click= "Editloadfile ()" > Cancel </a>
</div>
</div>
New system-pop-up window starts
$scope. Addsystem = function () {
$scope. yess = T2;
$scope. YES = T1;
$scope. NO = T2;
$scope. imagesrc = "";
$ (' #fileItem '). Val ("");
$scope. Createuser_add = $scope. Loginlist.employeename
}
New System-Re-select
$scope. Chooseagain = function () {
$scope. YES = T1;
$scope. yess = T2;
$scope. NO = T2;
$scope. Fileitem = null;
$scope. imagesrc = false;
}
New system-Upload Image Preview
$scope. GetFile = function () {
Filereader.readasdataurl ($scope. File, $scope)
. then (function (Result) {
$scope. Sysimagepc_edit = result;
$scope. yess = T1;
$scope. Sysimagepc_edit = result;
$scope. imagesrc = result;
$scope. Fileitem = $scope. File;
});
};
New System-click Upload
$scope. Uploadstatus = false;
var uploader = $scope. Uploader = new Fileuploader ({
URL: '/fileservlet ',
Queuelimit:1,
Removeafterupload:true
});
Uploader.onafteraddingfile = function (Fileitem) {
$scope. Fileitem = Fileitem._file;
};
Uploader.onsuccessitem = function (Fileitem, response, status, headers) {
$scope. Uploadstatus = true;
$scope. Sysimagepc_add = response;
$scope. Sysimagepc_edit = response;
$scope. yess = T2;
$scope. YES = T2;
$scope. NO = T1;
};
$scope. UploadFile = function () {
Uploader.uploadall ();
};
New product-Select Image--Cancel
$scope. Editloadfile = function () {
$scope. YES = T1;
$scope. yess = T2;
$scope. NO = T2;
$ (' #fileItem '). Val ("");
$scope. Fileitem = $scope. Sysimagepc_edit;
};
This article from "Purple Maple 5966" blog, reproduced please contact the author!
AngularJS File-up-load Upload Image