uploadthing icon indicating copy to clipboard operation
uploadthing copied to clipboard

[bug]: uploadthing/react - Java-Archive(.jar) file upload type does not show up when choosing files

Open SuperRonanCraft opened this issue 10 months ago โ€ข 5 comments

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

  • [x] I agree to follow this project's Code of Conduct

SuperRonanCraft avatar Feb 23 '25 23:02 SuperRonanCraft

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

markflorkowski avatar Feb 26 '25 19:02 markflorkowski

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?

SuperRonanCraft avatar Feb 26 '25 20:02 SuperRonanCraft

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

markflorkowski avatar Feb 26 '25 22:02 markflorkowski

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

SuperRonanCraft avatar Feb 26 '25 23:02 SuperRonanCraft

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.

markflorkowski avatar Feb 27 '25 05:02 markflorkowski