Skip to content

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

@SuperRonanCraft

Description

@SuperRonanCraft

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    PRs AcceptedAnyone feel free to pick this uparea:packagesissue regarding one of the uploadthing packages✨ enhancementsuggestion or feature request to improve uploadthing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions