File convert to URL

<input id="img" type="file" data-action="logo-upload">
event = {
'change [data-action="logo-upload"]': 'logoUpload',
        }

logoUpload = function(e){
 var file = e.currentTarget.files[0];
 var urlFile = URL.createObjectURL(file);
 console.log("urlFile",urlFile)
}

Leave a comment

Your email address will not be published. Required fields are marked *