我需要刪除輸入[文件]文本時,上傳的文件超過5MB清除文本輸入文件
$('input:file').change(
function(e) {
var files = e.originalEvent.target.files;
for (var i=0, len=files.length; i<len; i++){
var n = files[i].name,
s = files[i].size,
t = files[i].type;
if (s > 5242880) {
alert('Please deselect this file: "' + n + '," it\'s larger than the maximum filesize allowed. Sorry!');
}
}
});
我該怎麼辦大?
http://jsfiddle.net/eHNJg/338/
的感謝!