upto16char_filenamemax

This commit is contained in:
scossa 2024-08-21 01:24:06 +02:00
parent e0db8ed91d
commit fa9b904e00

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 > 10 ? fileName.slice(0, 10) + '...' : fileName;
const truncatedFileName = fileName.length > 16 ? fileName.slice(0, 16) + '...' : fileName;
document.querySelector('.file-chosen').textContent = truncatedFileName;
});