network.js icon indicating copy to clipboard operation
network.js copied to clipboard

Can't upload large data chunks with Chrome

Open cvigano opened this issue 10 years ago • 3 comments

This is an error I get when using Firefox to test the upload speed. Am I hitting some internal browser limit there?

The last request made was for the size of 512M.

On Chrome and Firefox, the end event is never fired for the upload.

cvigano avatar May 07 '15 10:05 cvigano

Sorry for the delay, I just came back from my vacations.

512M is a pretty high value, I don't think many browsers can handle this today. As you said, it's probably an internal browser limit. I will try to fix this if possible but I don't think I will be able to.

nesk avatar May 24 '15 14:05 nesk

I'm thinking again about this issue. Theoretically, the current browsers can upload very large files without any issues. I should create a 1GB file on my hard drive, pass it through an <input type="file"> and upload it through an XHR request, using the File API. If everything works, then the current issue is caused by a crappy blob object and the following points could help:

  • The Blob constructor accepts multiple parts, currently I generate only one part (an ArrayBuffer) and create the blob with it. What if we provide multiple parts to create the blob? I could try with 512B parts.
  • Maybe we could specify the type of the blob, like application/octet-binary.
  • Traditionally, a file is uploaded through a form, what about uploading the blob using the FormData API?
  • If everything fails, maybe we should upload another type of data ? Like a String (urgh) or directly an ArrayBuffer.

nesk avatar Dec 01 '15 16:12 nesk

So, uploading a 1GB file through an XHR request works. However, none of the considered solutions worked. This issue is probably related to this one on Chomium's bug tracker (I will update the README to link to this issue).

Another solution could be to create a FormData object, append a blob (say, 200MB), and once the upload is near the end, append a new blob and close the old one. But this is probably impossible.

The last solution would be to make multiple uploads, that will be probably what I will end for, but it will surely distort the measures.

Btw, it seems like Firefox is no longer affected by this issue.

nesk avatar Dec 04 '15 14:12 nesk