element-hq / element-android

A Matrix collaboration client for Android.
https://element.io/
GNU Affero General Public License v3.0
3.37k stars 718 forks source link

File is too large to upload, while server limit is much higher #5164

Open Fmajor opened 2 years ago

Fmajor commented 2 years ago

Steps to reproduce

  1. I set up a self-hosted Synapse server using the docker image: matrixdotorg/synapse:latest, 1dbbb05f33da
  2. I raise the default max_upload_size config to 500M
  3. I use a nginx reverse proxy, so I also set the client_max_body_size 500M;
    
    location ~ ^(/_matrix|/_synapse/client) {
    proxy_pass http://synapse;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header Host $host;
    # Nginx by default only allows file uploads up to 1M in size
    # Increase client_max_body_size to match max_upload_size defined in homeserver.yaml
    client_max_body_size 500M;
    }
  4. when I try to upload files (in element-android) that larger than 50M, it raise File is too large to upload
  5. I try files with different sizes, 49M is ok, 53M is not ok.


### Outcome

#### What did you expect?
file <500M be uploaded
#### What happened instead?
file >50M failed to upload

### Your phone model

Google Pixel 4L

### Operating system version

Android 12

### Application version and app store

Element 1.3.15 from F-droid

### Homeserver

docker image: matrixdotorg/synapse:latest, hash:1dbbb05f33da

### Will you send logs?

No
Fmajor commented 2 years ago

may be related with pr #3264

shanold commented 1 month ago

Exact same issue its limiting to 50MB though my Nginx and server limit is way higher.