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

124
Views
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
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!