upto21char_filename

This commit is contained in:
scossa 2024-08-21 01:28:03 +02:00
parent fa9b904e00
commit 9d5a7f8b71

View file

@ -1,6 +1,6 @@
document.getElementById('file-input').addEventListener('change', function() {
const fileName = this.files[0] ? this.files[0].name : 'No file chosen';
const truncatedFileName = fileName.length > 16 ? fileName.slice(0, 16) + '...' : fileName;
const truncatedFileName = fileName.length > 21 ? fileName.slice(0, 21) + '...' : fileName;
document.querySelector('.file-chosen').textContent = truncatedFileName;
});