jQuery Get File Extension Before Uploading File

Posted on October 4, 2019 at 3:29 pm

A jQuery example of how to get file size before uploading:

$('input[type=file]').change(function(e){
 
    var ext = e.target.files[0].name.replace(/^.*\./, '').toLowerCase();
 
    alert("File Extension: " + ext);
 
    ...
});

Receive updates via email

Other Posts

Updated Posts