srkprasad
srkprasad

Reputation: 65

file upload finish remove file name?

I am using angularjs,my problem is after upload file the file name is still on brows button.i want delete filename after upload a file,after upload a file (upload complete) i want to show no file selected. this is my example. Fiddle

Upvotes: 0

Views: 1887

Answers (2)

Manwal
Manwal

Reputation: 23816

You fiddle Demo having errors

  • Angular library not included
  • Missing ng-app="myApp"

Consider following code its working as you want:

var myApp = angular.module('myApp', []);
myApp.controller('myCtrl', function($scope) {
    $scope.upload = function(){
        alert('Removing file');
        $scope.myFile = "";
    };
});

Working DEMO

Upvotes: 1

Vicky
Vicky

Reputation: 378

Write this css for that.

input[type="file"]{
width:90px; /*reduce input width*/
color: transparent /*text will be there but not visible*/
}

or

input[type="file"]{
    color: transparent; /*text will be there but not visible*/
}

Upvotes: 0

Related Questions