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

271
Views
¿Cómo hacer un objeto de blob de imagen javascript en reaccionar nativo?

Tengo que hacer un objeto de blob de imagen como este:

ingrese la descripción de la imagen aquí

Ahora puedo obtener la URL base64 de la imagen en reaccionar nativo que almaceno en una variable:

 const base64 = img.data;

Lo he intentado de esta manera pero no funcionó:

 function b64toBlob(dataURI) { var byteString = atob(dataURI.split(',')[1]); var ab = new ArrayBuffer(byteString.length); var ia = new Uint8Array(ab); for (var i = 0; i < byteString.length; i++) { ia[i] = byteString.charCodeAt(i); } return new Blob([ab], {type: 'image/jpeg'}); } const blob = b64toBlob(base64); console.log(blob);

ingrese la descripción de la imagen aquí

 const base64 = img.data;

Ahora, ¿cómo puedo crear un objeto blob como la imagen de arriba con esta variable base64 en reaccionar nativo?

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

0

Resolví el problema de esta manera:

 ImagePicker.openPicker({ width: 400, height: 400, cropping: true, includeBase64: true, }) .then(image => { setImg(image); }) .then(() => setModalVisible(prev => !prev)); const image = { name: nn, uri: img.path, type: img.mime, size: img.size, lastModifiedDate: JSON.parse(img.modificationDate), uid: img.modificationDate, }; const form = new FormData(); form.append('file', image); axios .post('url', form, { headers: { Authorization: `bearer ${JSON.parse(token)}`, }, })
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!