[BUG] `ERR_FS_FILE_TOO_LARGE` when trying to upload a file bigger than 2GB
See original GitHub issueContext:
- Playwright Version: 1.17.1
- Operating System: Windows 11
- Node.js version: 16.13.0
- Browser: Chromium
Code Snippet
const {chromium} = require('playwright');
(async () => {
const browser = await chromium.launch();
const context = await browser.newContext();
await context.clearCookies();
await context.addCookies(cookies);
const page = await context.newPage();
await page.goto("https://www.youtube.com/channel_switcher");
await page.click(`text=${channel.youtubeChannelName}`);
await page.goto("https://studio.youtube.com/");
await page.click('ytcp-button[role="button"]:has-text("Create")');
await page.click("text=Upload videos");
await page.click('ytcp-button[role="button"]:has-text("Select files")');
await page.setInputFiles(
'ytcp-button[role="button"]:has-text("Select files")',
videoToUpload
); // triggers error
})();
Describe the bug
The following error appears:
page.setInputFiles: File size (5935778423) is greater than 2 GB
Alternative that also doesn’t work
I also tested like this and I get the same error:
const [fileChooser] = await Promise.all([
page.waitForEvent("filechooser"),
page.click('ytcp-button[role="button"]:has-text("Select files")'),
]);
await fileChooser.setFiles(videoToUpload);
My own investigation
This error only happens when I use the code from playwright for uploading. But if I use a await page.pause()
and select the file manually on the File Chooser, the upload works.
From what I understand from the error, is that Playwright will load the file on Node memory (notice FS
on the error code) and try to send it to the File Chooser from a Buffer or something similar. But why can’t I just send a path to the File Chooser instead of loading it on the memory?
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
When a large file upload exceeds the 2GB limit, do I expect ...
The error message I'm getting is "One or More Files Failed to Upload". Is this because the file size is too large or...
Read more >Unable to upload software image larger than 2GB using ...
When attempting to import a software image file over 2GB in size via Configuration Utility (GUI), it may not show any progress in...
Read more >Cannot upload files larger than 2Gb - Server
Whenever I try to upload a file that is larger than 2Gb I get an error like "Error uploading file "four": Internal Server...
Read more >Copying files exceeding 2 GB fails - Windows Server
When you try to copy a file larger than 2 GB by using Remote Desktop Protocol (RDP) client 6.0 or later, the file...
Read more >Upload a huge file ~2GB size causes browser error
I'm not sure that I would re-invent the wheel by trying to chunk the file yourself. Look into an AngularJS file upload library...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@italodeandra this is actually a dupe of #3768. And good news, #3768 is now prioritized!
So I’ll close this as a dupe.
Hello! I’m still getting this error when I am trying to upload a file grater then 2 GB
RangeError [ERR_FS_FILE_TOO_LARGE]: File size (3235260344) is greater than 2 GB
. Is there any update for the files that are larger than 2GB ?