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

126
Vistas
HTTP PUT to google storage fails in firefox for larger files

I am using resumable upload with no problem on chromium browsers. I use js, specifically angular.

 let headers = new HttpHeaders(
  {
    'Content-Type': 'application/octet-stream',
    'Content-Range': 'bytes 0-*/*',
  });
if (offset) {
  headers = headers.set('Content-Range', 'bytes ' + (offset + 1) + '-*/*');
  params = (params.slice(offset + 1) as File);
}
const req = new HttpRequest(
  'PUT',
  url,
  params,
  { headers, reportProgress: true },
);
return this.http.request<File>(req);

On firefox, for some reason, if the file is over 5GB, it fails nondeterministically of time, uploaded size or percent of upload. Usually it is around 300s and/or 2-3GBs. The upload starts fine, but somewhere on the way it fails.

I get a CORS error at that point and am unable to resume the upload.

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://storage.googleapis.com/repo-name/uploads/guid?upload_id=blahblah&uploadType=resumable. (Reason: CORS request did not succeed)

I tried manually upload the same set of files to google drive manually in firefox and sure enough, I also get the CORS error, but their implementation is better I guess, because they are able to resume the upload, but after a while it throws the same error.

The only difference I see is I am trying to do one PUT request (unless it fails, then I send the other chunks in seperate one), on google drive, they chunk it and do a bunch of PUTs. They also correctly identify the content-type as ie. video/x-matroska, I use octet-stream.

It works for files under 4GB in firefox and works regardless of size in Chromium browsers. Any tips on what I am doing worng?

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