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

390
Views
¿Cómo convierto img url en un archivo de objeto blob en javascript?

Estoy tratando de convertir el enlace img en blob. Quiero enviar el blob como archivo de objeto, actualmente tengo el blob como [objeto HTMLImageElement]. ¿Cómo soluciono esto y lo envío como blob [archivo objeto]?

Esto es lo que estoy tratando de lograr ingrese la descripción de la imagen aquí

 var myImage; fetch('https://cdn.vox-cdn.com/thumbor/4hL2bA5OUf0lSqR2WlY9ogSYtTE=/152x62:1340x953/920x613/filters:focal(615x92:829x306):format(webp)/cdn.vox-cdn.com/uploads/chorus_image/image/66220207/the_child_star_wars_gallery_5e3204be4f668.0.jpg') .then(res => res.blob()) // Gets the response and returns it as a blob .then(blob => { let objectURL = URL.createObjectURL(blob); myImage = new Image(); myImage.src = objectURL; console.log(myImage); }); $("#approve").click(function() { var logoFilename = myImage; let formData = new FormData(); formData.append('logo', logoFilename); for (var pair of formData.entries()) { console.log(pair[0] + ', ' + pair[1]); } });
 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <button type="button" id="approve" name="approve" class="btn btn-success">Approve</button>

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!