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]: uploadthing/react - Java-Archive(.jar) file upload type does not show up when choosing files #1157

Open
1 of 2 tasks
SuperRonanCraft opened this issue Feb 23, 2025 · 5 comments
Labels
area:packages issue regarding one of the uploadthing packages 🐛 bug: unconfirmed

Comments

@SuperRonanCraft
Copy link

Provide environment information

System:
    OS: Windows 11 10.0.26100
    CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-12700KF
    Memory: 12.70 GB / 31.85 GB
  Binaries:
    Node: 20.14.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.22 - C:\Program Files\nodejs\yarn.CMD
    npm: 10.7.0 - C:\Program Files\nodejs\npm.CMD
    pnpm: 9.11.0 - C:\Program Files\nodejs\pnpm.CMD
  Browsers:
    Edge: Chromium (127.0.2651.74)
    Internet Explorer: 11.0.26100.1882
  npmPackages:
    @uploadthing/react: 7.3.0 => 7.3.0
    typescript: ^5.7.3 => 5.7.3
    uploadthing: 7.5.2 => 7.5.2

Describe the bug

When I set the accepted file types to upload to "application/java-archive" I get the accepted files in my file-explorer to upload All Files (*.*) instead of only .jar

Image

Link to reproduction

https://stackblitz.com/edit/github-92heuda2?file=src%2Fserver%2Fuploadthing.ts

To reproduce

Set the allowed file types to "application/java-archive" and try to upload a file
Add to the config

resourceUpload: f({
    'application/java-archive': { maxFileSize: '16MB' }, //Will only allow ALL files
    // 'application/zip': { maxFileSize: '16MB' }, //Will only allow .zip even if java-archive is active
  })

uncomment the zip and you will only be able to upload .zip files

Additional information

Would love if I could set a custom list of file types the button will allow me to upload by default

👨‍👧‍👦 Contributing

  • 🙋‍♂️ Yes, I'd be down to file a PR fixing this bug!

Code of Conduct

  • I agree to follow this project's Code of Conduct
@SuperRonanCraft SuperRonanCraft added area:packages issue regarding one of the uploadthing packages 🐛 bug: unconfirmed labels Feb 23, 2025
@markflorkowski
Copy link
Collaborator

I believe this is a browser/platform issue, not an Uploadthing issue, as both cases are working fine for me on Arc/MacOS.

Screen.Recording.2025-02-26.at.11.50.50.mov

@SuperRonanCraft
Copy link
Author

SuperRonanCraft commented Feb 26, 2025

I believe this is a browser/platform issue, not an Uploadthing issue, as both cases are working fine for me on Arc/MacOS.

Screen.Recording.2025-02-26.at.11.50.50.mov

Would there be any way to fix this? I'm using the most used browser in the world Chrome, and the latest version of windows 11, has to be a way to support it.
Maybe am I able to set the specific files the client can upload by default by overriding their types?

@markflorkowski
Copy link
Collaborator

Can you try out this tester and let me know which (if any) of the inputs properly filter for you?

https://codepen.io/retool-mark/full/OPJbWwK

@SuperRonanCraft
Copy link
Author

Thats a nice tester there.
All seem to work MINUS the application/java-archive file type
The rest filter out the correct stuff on my file explorer

@markflorkowski
Copy link
Collaborator

Ok, we are using mime types like that for the UT components, so that lines up. I think we might be able to do mimes + extensions though for better windows support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:packages issue regarding one of the uploadthing packages 🐛 bug: unconfirmed
Projects
None yet
Development

No branches or pull requests

2 participants