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

176
Vistas
Random access to a file in browser File API

I can use the File API to read the whole file with reader.readAsArrayBuffer(file);

const inputElement = document.getElementById("input");
inputElement.addEventListener("change", handleFiles, false);

function handleFiles() {
  const fileList = this.files;
  if (fileList.length != 1) return
  const file = fileList[0];

  const reader = new FileReader();
  reader.onload = function(e) {
    console.log("e.target.result", e.target.result);
    ...
  }
  reader.readAsArrayBuffer(file);

How do I perform a random read on a file in the browser? e.g. reader.readAsArrayBuffer(file, offset, length);

The data I need is at the end of the file, so aborting after a partial read is not a solution.

I only want to read a small part of a multi-GB file - reading it all to RAM is not an option. How can I do this?

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