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

2.1.1 broke uploadFile #5527

Closed
olizh opened this issue Mar 20, 2020 · 5 comments
Closed

2.1.1 broke uploadFile #5527

olizh opened this issue Mar 20, 2020 · 5 comments

Comments

@olizh
Copy link

olizh commented Mar 20, 2020

Steps to reproduce

Tell us about your environment:

  • Puppeteer version: 2.1.1
  • Platform / OS version:Mac OS 10.15.3 (19D76)
  • URLs (if applicable):
  • Node.js version: v12.13.0

What steps will reproduce the problem?
Run the following line in either headless or headful mode:
inputUploadHandle.uploadFile(filepath);

What is the expected result?
In version 2.0.0, when uploadFile is executed, the file will be selected. You can see this if you are using headful mode.

What happens instead?
However, in version 2.1.1, uploadFile results in nothing.

@renfeng
Copy link

renfeng commented Mar 27, 2020

It seems to be broken since 2.1.0

@m1m1s1ku
Copy link

m1m1s1ku commented Mar 28, 2020

#5358

Also, enforcing a "change" event can resolve files input not updated in 2.1.1 but mimeType isn't ok

@olizh
Copy link
Author

olizh commented Mar 28, 2020

It seems to be broken since 2.1.0

I haven't checked 2.1.0, but I've seen other people talked about 2.1.0 broke uploadFile. So it's probably broken in 2.1.0 and haven't been fixed in 2.1.1.

@DavertMik
Copy link

I downgraded to 2.0.0 but that does not solve the problem - filetype detection doesn't work there.

      AssertionError: expected 'application/octet-stream' to deeply equal 'image/jpeg'
      + expected - actual
      -application/octet-stream
      +image/jpeg

If Puppeteer team finally gets this to be fixed, I hope they also get the file type detection back.

@paullewis
Copy link
Contributor

This should be fixed as of 532ae57 as we changed the underlying implementation to use DOM.setFileInputFiles, which behaves a lot more as expected. We also fire events for change and input, too. Going to close this issue, but please let us know if it's not fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants