About 52 results
Open links in new tab
  1. How can I get file extensions with JavaScript? - Stack Overflow

    Oct 10, 2008 · How can I get file extensions with JavaScript? Asked 17 years, 4 months ago Modified 1 year, 9 months ago Viewed 901k times

  2. How to extract extension from filename string in Javascript?

    Mar 25, 2009 · how would i get the File extension of the file in a variable? like if I have a file as 1.txt I need the txt part of it.

  3. Required file extension for JavaScript files - Stack Overflow

    Aug 11, 2015 · It can be very beneficial when you need a dynamic script file, which is how I got here. I was able to build my script file in php for building a dynamic list of Google map markers being pulled …

  4. javascript - Extract filename and extension in js - Stack Overflow

    Jan 9, 2018 · 4 You can use the split() function combined with pop() to get the file full name (name + extension) and detect the separation between your file name and extension with lastIndexOf() :

  5. Getting the default file extension for a content-type in JavaScript?

    Jan 10, 2012 · If there is no way to get these extensions automatically in JavaScript, my next solution would be to create a simple relationship between content-type and file extension in a JavaScript …

  6. How do I change file extension with javascript - Stack Overflow

    Aug 18, 2015 · Does anyone know an easy way to change a file extension in Javascript? For example, I have a variable with "first.docx" but I need to change it to "first.html".

  7. javascript - How to Find List of Files with Certain Extension From an ...

    Jun 16, 2016 · The challenge was this: Create a program that prints a list of files in a given directory, filtered by the extension of the files. You will be provided a directory name as the first argument to …

  8. Get the file extension in the JavaScript - Stack Overflow

    Jan 30, 2021 · I have a problem checking what is an extension in my multiple input files. I am added pathinfo in the javascript and alert to check the file extension, but cannot work. Below is my coding: <!

  9. Javascript regex for matching/extracting file extension

    The following regex var patt1=/[0-9a-z]+$/i; extracts the file extension of strings such as filename-jpg filename#gif filename.png How to modify this regular expression to only return an extens...

  10. When do we need to add file extension when importing JavaScript …

    Jun 3, 2022 · Otherwise, the file extension is resolved using the resolve.extensions option, which tells the resolver which extensions are acceptable for resolution, e.g. .js, .jsx.