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

328
Views
Cómo subir una imagen con base64 y validarla con formik

Quiero manejarlo con formik y base64

const [postImage, setPostImage]: cualquiera = React.useState({ miArchivo: '', })

 const convertToBase64 = (file: any) => { return new Promise((resolve, reject) => { const fileReader = new FileReader() fileReader.readAsDataURL(file) fileReader.onload = () => { resolve(fileReader.result) } fileReader.onerror = (error) => { reject(error) } }) } const handleFileUpload = async (e: any) => { const file = e.target.files[0] const base64 = await convertToBase64(file) setPostImage({...postImage, myFile: base64}) }

<input type='file' multiple className='form-control' name='images' accept='.jpeg, .png, .jpg' // value={props.postImage.myFile} onChange={uploadImage} />

about 4 years ago · Juan Pablo Isaza
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!