adsense

Friday, July 14, 2017

Retrieve the uploaded file extension from JavaScript

Following java script unction can be used to get the extension of a uploaded file.

function getFileExtension(fileName)
{
  var extension = /^.+\.([^.]+)$/.exec(fileName);
  return extension == null ? "" : extension [1];
}

Cheers
Samitha

No comments:

Post a Comment