Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

get file extension file upload control in javascript

function getFile(filePath) {
        return filePath.substr(filePath.lastIndexOf('') + 1).split('.')[0];
    }

    function getoutput() {
        outputfile.value = getFile(inputfile.value);
        extension.value = inputfile.value.split('.')[1];
    }
Comment

get file extension file upload control in javascript

<input id='inputfile' type='file' name='inputfile' onChange='getoutput()'><br>
    Output Filename <input id='outputfile' type='text' name='outputfile'><br>
    Extension <input id='extension' type='text' name='extension'>
Comment

PREVIOUS NEXT
Code Example
Javascript :: append textarea jquery with value 
Javascript :: method chaining in javascript 
Javascript :: Find the index of an item in the Array 
Javascript :: clear input field data in jquery 
Javascript :: react router link with params 
Javascript :: mongoose count 
Javascript :: js var vs let 
Javascript :: vue displaying a this.length 
Javascript :: aes 256 file encryption node js 
Javascript :: javascript check if element has specific child 
Javascript :: Encoding and Decoding Base64 Strings in Node.js 
Javascript :: TypeError: navigation.getParams is not a function. 
Javascript :: hex decima to binary js 
Javascript :: javascript get smaller of two numbers 
Javascript :: global variable vuejs 
Javascript :: how to insert with variables from js to mysql 
Javascript :: regex 
Javascript :: arrow functions 
Javascript :: react render twice v18 
Javascript :: jest tranform image 
Javascript :: put logo in qr code in react js qrcode.react 
Javascript :: js setinterval vs settimeout 
Javascript :: mongodb working with date 
Javascript :: office check in 
Javascript :: npm set author name 
Javascript :: requirejs example 
Javascript :: ios/main.jsbundle no such file or directory react native 
Javascript :: uppercase first letter js 
Javascript :: javascript turn negative number to positibve 
Javascript :: check object has key javascript 
ADD CONTENT
Topic
Content
Source link
Name
9+3 =