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]: Uploads above 8MB not accepted #151

Open
BomberFish opened this issue May 14, 2023 · 1 comment
Open

[Bug]: Uploads above 8MB not accepted #151

BomberFish opened this issue May 14, 2023 · 1 comment
Labels
ui User interface-related issues

Comments

@BomberFish
Copy link
Contributor

Describe the Bug

Bug Description

Any file above 8 megabytes is not accepted. Recently, Discord changed the free file upload limit to 25 megabytes, and level 2 and 3 boosted servers increase the limit for all users to 50 and 100 megabytes respectively.

Actual Behaviour

The upload fails.
Screenshot taken on 2023-05-14 at 18 55 59

Expected Behavior

The upload should succeed.

Reproducing the Bug

  1. Upload file bigger than 8MB and less than 25MB on a nitroless account
  2. See it get denied :(

Version

0.6.1

Category

Media (images, audio, video etc.)

Relevant Log Output

No response

Screenshots

No response

Additional Info

No response

@BomberFish BomberFish added bug Something isn't working triage Waiting for this issue to be triaged labels May 14, 2023
@cryptoAlgorithm
Copy link
Member

Ah this is due to the file size limit being hardcoded in the upload check. It would simply require a single change here:

guard let size = try? attachment.resourceValues(forKeys: [URLResourceKey.fileSizeKey]).fileSize, size < 8*1024*1024 else {

Something along the lines of

- guard let size = try? attachment.resourceValues(forKeys: [URLResourceKey.fileSizeKey]).fileSize, size < 8*1024*1024 else { 
+ guard let size = try? attachment.resourceValues(forKeys: [URLResourceKey.fileSizeKey]).fileSize, size < 25*1024*1024 else { 

@cryptoAlgorithm cryptoAlgorithm added ui User interface-related issues and removed bug Something isn't working triage Waiting for this issue to be triaged labels May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ui User interface-related issues
Projects
None yet
Development

No branches or pull requests

2 participants