Answers for "get local path for file upload javascript"

1

get local path for file upload javascript

const onChange = (event) => {
  const value = event.target.value;

  // this will return C:\fakepath\somefile.ext
  console.log(value);

  const files = event.target.files;

  //this will return an ARRAY of File object
  console.log(files);
}

return (
 <input type="file" onChange={onChange} />
)
/* Found from Stack Overflow */
Posted by: Guest on October-08-2020

Code answers related to "get local path for file upload javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language