Program to check if a file is .zip in javascript

Rajnilari2015
Posted by Rajnilari2015 under JavaScript category on | Points: 40 | Views : 452
       var file = "test.zip"
var fileExtension = file.substring(file.lastIndexOf(".")+1)
if(fileExtension === "zip") {alert('its a zip file');}
else {alert('its not a zip file');}

Comments or Responses

Login to post response