簡體   English   中英

文件上傳完成后刪除文件名?

[英]file upload finish remove file name?

我正在使用angularjs,我的問題是上傳文件后文件名仍在眉毛按鈕上。我想在上傳文件后刪除文件名,上傳文件后(上傳完成)我想顯示未選擇文件。 這是我的例子。 Fiddle

您擺弄演示有錯誤

  • Angular library not included
  • 缺少ng-app="myApp"

考慮使用下面的代碼,根據需要進行工作:

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

工作演示

為此寫這個css。

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

要么

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM