Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

148
Vistas
How to send a file with web serial api

I am currently building a web application that allows users to type text and send an image that would be send to a laser engraver through a serial port. Now I'm stuck with a problem which is I can send a gcode string to the laser engraver but I can't send a file, so how would I send a file with Web Serial API.

let imageShow = canvas.toDataURL();
const regex = /data:.*base64,/;
console.log(imageShow.replace(regex, ""));
imageShow.replace(regex, "");       
function b64_to_utf8(str) {
     return decodeURIComponent(escape(window.atob(str)));
}
image = b64_to_utf8(imageShow);
const encoder = new TextEncoder();
const writer = port.writable.getWriter();
await writer.write(encoder.encode(image));
writer.releaseLock();
about 4 years ago · Santiago Gelvez
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda