Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

fakepath js

var input = document.getElementById("inputFile");
var fReader = new FileReader();
fReader.readAsDataURL(input.files[0]);
fReader.onloadend = function(event){
    var img = document.getElementById("yourImgTag");
    img.src = event.target.result;
}
Comment

js C:fakepath

// Use
document.getElementById("file-id").files[0].name; 

// instead of
document.getElementById('file-id').value
Comment

PREVIOUS NEXT
Code Example
Javascript :: truncate a string js 
Javascript :: how to check all elements in array includes in another array javascript 
Javascript :: querySelectorAll by id regex 
Javascript :: javascript find all matches in array 
Javascript :: javascript array to object with keys 
Javascript :: how to read 2 dimensional array in javascript 
Javascript :: sort by string react 
Javascript :: express how to refresh 
Javascript :: select default value react 
Javascript :: js order string 
Javascript :: vowel array 
Javascript :: restrict the user from going to signup or login page if the user is already logged in firebase auth 
Javascript :: js window.alert 
Javascript :: for open new tab we are using window.open but new tab are open in left side how to change the right side 
Javascript :: how to remove space in input field html 
Javascript :: countdown using vue 
Javascript :: trim string after - in jquery 
Javascript :: regex match exact string 
Javascript :: hover effect in material ui 
Javascript :: detect a click outside an element javascript 
Javascript :: filter array inside array 
Javascript :: javascript onclick select coordinates 
Javascript :: get all keys in json object 
Javascript :: Min-Stack Optimized Solution Via JS 
Javascript :: @angular/common@11.2.1 node_modules/@angular/common @angular/common@"11.2.1" from the root project 
Javascript :: javascript sort numbers descending 
Javascript :: regex is not empty string 
Javascript :: settimeout in javascript 
Javascript :: react js get screen size 
Javascript :: url params vue 
ADD CONTENT
Topic
Content
Source link
Name
8+7 =