Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] I cannot upload large files #273

Open
amartinez1558 opened this issue Feb 10, 2021 · 8 comments
Open

[Bug] I cannot upload large files #273

amartinez1558 opened this issue Feb 10, 2021 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@amartinez1558
Copy link

amartinez1558 commented Feb 10, 2021

Current behavior:

I have a file that's 100MBs in size. It seems that the cy.fixture is trying to load this into memory before attaching to target input. It seems that this plugin doesn't play well with large files. Can you think of any workaround? Thanks!

Desired behavior:

I should be able to upload 100MB to 1GB files without delay.

Steps to reproduce: (app code and test code)

cy.get('#uploadInput')
.attachFile('100MB-File');

=> either a timeout issue or the following Invalid string length

image

Versions

Cypress v6.3.0
Cypress File Upload v5.0.2

@amartinez1558 amartinez1558 added the bug Something isn't working label Feb 10, 2021
@amartinez1558 amartinez1558 changed the title [Bug] [Bug] I cannot upload large files Feb 10, 2021
@LoganWlv
Copy link

LoganWlv commented Jun 7, 2021

Having the same issue though the error is slightly different (~500MB .csv file):

image

"@testing-library/cypress": "^7.0.6",
"clipboardy": "^2.3.0",
"cypress": "^7.4.0",
"cypress-cucumber-preprocessor": "^4.1.0",
"cypress-file-upload": "^5.0.7"

The error occurs in Cypress.cy.fixture(filePath, fileEncoding)

Relates to ?
cypress-io/cypress#16823

@sprotznock85
Copy link

This is still an issue and has nothing to do with the server side.
How can this be down by a workaround?
I try it with a one Gb file. This is working well in production but not with cypress.
Is it possible to trigger the change event of the input type file?

@sprotznock85
Copy link

Really need a workaround on this bug. Cannot use cypress otherwise. Any help?

@adammfrank
Copy link

I also need this.

@Wheedman
Copy link

I also stumbled now over this and it would be nice to have a workaround for that

@vvip-68
Copy link

vvip-68 commented Oct 10, 2023

October 2023... Issue still not solved. I need to upload files approx 500 MB...
Anybody solved or find workaround?

@Ralkage
Copy link

Ralkage commented Oct 19, 2023

This is likely a Node.js limitation. Node.js serves as the underlying runtime for Cypress and imposes constraints on string sizes to prevent excessive memory consumption. Unfortunately, this limit is not easily adjustable.

To tackle this issue, you might need to consider the following approaches:

Upload Smaller Chunks:

  • If you're attempting to upload a rather large file (500 MB+), consider breaking it into smaller chunks and uploading them sequentially rather than as a single large file.

Use an Alternative Method:

  • Depending on your specific use case, you may discover an alternative approach for uploading or processing large files, such as streaming the data instead of holding it in memory.

My team and I are currently exploring these options, and if we find a workaround for this issue, I will share it here!

@Ralkage
Copy link

Ralkage commented Nov 1, 2023

FYI, we haven't found a workaround for this specific issue yet. A colleague who's assisting us in finding a possible solution came across this StackOverflow post that might shed light on why we're facing challenges when working with large files in Cypress. It's worth noting that this issue doesn't occur on my other colleague's machine, who uses MacOS on his Macbook M1. Our team continues to investigate potential workarounds, but at this moment, we haven't discovered an alternative for handling file uploads of 500 MB or more using Cypress on Windows or Linux machines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants