Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

128
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda