all articles

how to get filename on ie9

2016-09-16 @sunderls

ie9 filename js





desc

for modern browsers, we can get filename from file input by

$input[0].files[0].name

while it is not working on ie9, we'd rather use the old fashion way:

$input.val().match(/[^\/\\]+$/)
// return an array ['d.gif']


如果觉得有帮助到你的话,
欢迎支付宝donate