Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

229
Views
How to get <input tag> from file path Folder Name in ReactJs

I using FileReader and I am trying but I got only getting FileName and FileFormat.

However, I couldn't How to get folderName Soma07

There are several modules available but I don't know how to make it work in React.

Does anybody know?

Here are the examples I found:

      const [fileName, setfileName] = useState("")
      const upLoadImage = async (e) => {
        const file = e.target.files[0]
        const base64 = await convertBase64(file);
        console.log(base64);
        setfileName(file.name)
      }
      const convertBase64 = (file) => {
        return new Promise((resolve, reject) => {
          const fileReader = new FileReader();
          fileReader.readAsDataURL(file);
    
          fileReader.onload = (() => {
            resolve(fileReader.result)
          })
          fileReader.onerror = ((error) => {
            reject(error)
          })
        })
      }
      
    

enter image description here

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Due to security reasons browsers don't allow to get file path. JavaScript in browser has no access to the File System.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!