Bug 175533 - Upload of large files (~100 MB) fails on Safari with Fetch/XHR
Summary: Upload of large files (~100 MB) fails on Safari with Fetch/XHR
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: Safari 10
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-08-14 06:19 PDT by Ebrahim Byagowi
Modified: 2021-01-14 11:09 PST (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ebrahim Byagowi 2017-08-14 06:19:58 PDT
Safari 10.1.2

Steps to repro:
0. Install a recent version of node.js, perhaps from brew by `brew install nodejs` (needed for the simple server setup)
1. Save content of below script to server.js:

"""
require('http').createServer((req, res) => {
  if (req.method === 'POST')  
    return req
      .on('data', () => undefined)
      .on('end', () => { res.end(req.url + ' uploaded!'); console.log(req.url + ' uploaded!'); })
      .on('close', () => console.log(req.url + ' connection has closed.'));

  res.writeHead(200, { 'Content-Type': 'text/html' });
  res.end(`<input type="file" onchange="
var formData = new FormData();
formData.append('blob', this.files[0], 'file');
fetch(this.files[0].name, { method: 'POST', body: formData }).then(x => x.text()).then(alert, alert);
">`);
}).listen(4040, '127.0.0.1', () => console.log('Listening on http://127.0.0.1:4040/'));
"""

2. Open http://127.0.0.1:4040/ and upload some small files first, then try to do the same with bigger files like 100mb or more, multiple times.


Expected:
Getting "uploaded" alert very consistently each time, like Chrome and Firefox.

Actual:
It works very inconsistently on Safari and gets timeout.
Comment 1 Radar WebKit Bug Importer 2017-08-14 10:58:22 PDT
<rdar://problem/33878674>
Comment 2 Ebrahim Byagowi 2017-08-23 13:04:04 PDT
Can you reproduce this issue there? Despite using an official build seemingly (Version 10.1.2 (12603.3.8)), it seems my Safari suffers from lots of thing as my console.log('text') also doesn't put anything on the console!!1
Comment 3 youenn fablet 2017-08-23 13:17:23 PDT
I tried with Safari 11 and STP and was able to upload files from 50MB to 8Go.

Can you try with Safari Tech Preview?
Comment 4 Ebrahim Byagowi 2017-08-24 12:26:28 PDT
I can not check it with Safari TP as just its recent version stoped to work here, I guess that has something to do with the oldness of my MacBook Air.
Comment 5 Ebrahim Byagowi 2021-01-13 23:43:23 PST
I don't see the issue any longer. Perhaps is fixed somewhere else. Thanks!
Comment 6 Alexey Proskuryakov 2021-01-14 11:09:57 PST
Thank you for the follow-up!